Добавлена загрузка и распарсивание текущей книги

This commit is contained in:
Book Pauk
2019-01-14 22:11:26 +07:00
parent 475afa553c
commit a81b38cf04
5 changed files with 63 additions and 4 deletions

View File

@@ -172,6 +172,8 @@ export default class BookParser {
this.para = para;
callback(100);
await sleep(10);
return {fb2};
}
}

View File

@@ -64,6 +64,17 @@ class BookManager {
return result;
}
hasBookParsed(meta) {
if (!this.books)
return false;
if (!meta.url)
return false;
if (!meta.key)
meta.key = this.keyFromUrl(meta.url);
let book = this.books[meta.key];
return (book && book.parsed);
}
async getBook(meta, callback) {
if (!this.books)
await this.init();