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

This commit is contained in:
Book Pauk
2022-11-12 17:23:21 +07:00
parent 2de9ad0edf
commit f174617f33
2 changed files with 5 additions and 5 deletions

View File

@@ -58,9 +58,9 @@ class RemoteLib {
}
}
async downloadBook(bookPath, downFileName) {
async downloadBook(bookId) {
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 buf = await this.down.load(`${this.remoteHost}${link}`, {decompress: false});

View File

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