about summary refs log tree commit diff stats
path: root/src/reader.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/reader.js')
-rw-r--r--src/reader.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/reader.js b/src/reader.js
index 7bcac76..0c61a0c 100644
--- a/src/reader.js
+++ b/src/reader.js
@@ -222,16 +222,20 @@ class ReaderClass extends AppCommon {
             console.log('requesting bookinfo for book', bookId)
 
             try {
-                const resp = await $.post("backend.php", {op: "getinfo", id: bookId });
+                /** @type{BookList} */
+                const resp = await $.post("backend.php", {op: "list", ids: bookId });
 
-                if (resp.has_cover) {
+                /** @type{BookInfo} */
+                const info = resp['books'][0];
+
+                if (info.has_cover) {
                     const cover = await fetch("backend.php?op=cover&id=" + bookId);
 
                     if (cover.ok)
                         await localforage.setItem(this.cacheId('cover'), cover.blob());
                 }
 
-                await localforage.setItem(this.cacheId(), resp);
+                await localforage.setItem(this.cacheId(), info);
 
                 console.log('bookinfo saved');