浏览代码

Исправлен баг при скачивании в режиме "Удаленная библиотека"

Book Pauk 2 年之前
父节点
当前提交
f174617f33
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      server/core/RemoteLib.js
  2. 3 3
      server/core/WebWorker.js

+ 2 - 2
server/core/RemoteLib.js

@@ -58,9 +58,9 @@ class RemoteLib {
         }
         }
     }
     }
 
 
-    async downloadBook(bookPath, downFileName) {
+    async downloadBook(bookId) {
         try {
         try {
-            const response = await await this.wsRequest({action: 'get-book-link', bookPath, downFileName});
+            const response = await await this.wsRequest({action: 'get-book-link', bookId});
             const link = response.link;
             const link = response.link;
 
 
             const buf = await this.down.load(`${this.remoteHost}${link}`, {decompress: false});
             const buf = await this.down.load(`${this.remoteHost}${link}`, {decompress: false});

+ 3 - 3
server/core/WebWorker.js

@@ -354,7 +354,7 @@ class WebWorker {
         }
         }
     }
     }
 
 
-    async restoreBook(bookPath, downFileName) {
+    async restoreBook(bookId, bookPath, downFileName) {
         const db = this.db;
         const db = this.db;
 
 
         let extractedFile = '';
         let extractedFile = '';
@@ -364,7 +364,7 @@ class WebWorker {
             extractedFile = await this.extractBook(bookPath);
             extractedFile = await this.extractBook(bookPath);
             hash = await utils.getFileHash(extractedFile, 'sha256', 'hex');
             hash = await utils.getFileHash(extractedFile, 'sha256', 'hex');
         } else {
         } else {
-            hash = await this.remoteLib.downloadBook(bookPath, downFileName);
+            hash = await this.remoteLib.downloadBook(bookId);
         }
         }
 
 
         const link = `${this.config.filesPathStatic}/${hash}`;
         const link = `${this.config.filesPathStatic}/${hash}`;
@@ -443,7 +443,7 @@ class WebWorker {
             }
             }
 
 
             if (!link) {
             if (!link) {
-                link = await this.restoreBook(bookPath, downFileName)
+                link = await this.restoreBook(bookId, bookPath, downFileName)
             }
             }
 
 
             if (!link)
             if (!link)