about summary refs log tree commit diff stats
path: root/classes/Handler/GetlastreadHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Handler/GetlastreadHandler.php')
-rw-r--r--classes/Handler/GetlastreadHandler.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/classes/Handler/GetlastreadHandler.php b/classes/Handler/GetlastreadHandler.php
index 8d0a1f2..d6b82e7 100644
--- a/classes/Handler/GetlastreadHandler.php
+++ b/classes/Handler/GetlastreadHandler.php
@@ -10,29 +10,29 @@ use Response;
 
 class GetlastreadHandler implements RequestHandlerInterface, AuthRequired
 {
-    public function handle(Request $request): Response
-    {
-        $bookid = (int) $request->getAttribute('id');
-        $owner = $_SESSION["owner"] ?? "";
+	public function handle(Request $request): Response
+	{
+		$bookid = (int) $request->getAttribute('id');
+		$owner = $_SESSION["owner"] ?? "";
 
-        if ($bookid) {
-            $book = ORM::for_table('epube_books')
-                ->where('bookid', $bookid)
-                ->where('owner', $owner)
-                ->find_one();
+		if ($bookid) {
+			$book = ORM::for_table('epube_books')
+				->where('bookid', $bookid)
+				->where('owner', $owner)
+				->find_one();
 
-            if ($book) {
-                return (new Response())->withBody(json_encode([
-                    "page" => (int)$book->lastread,
-                    "cfi" => $book->lastcfi,
-                    "total" => 100,
-                    "timestamp" => (int)$book->lastts
-                ]));
-            }
-        }
+			if ($book) {
+				return (new Response())->withBody(json_encode([
+					"page" => (int)$book->lastread,
+					"cfi" => $book->lastcfi,
+					"total" => 100,
+					"timestamp" => (int)$book->lastts
+				]));
+			}
+		}
 
-        return (new Response())
-            ->withStatus(404)
-            ->withBody("Not found.");
-    }
+		return (new Response())
+			->withStatus(404)
+			->withBody("Not found.");
+	}
 }