Небольшая оптимизация
This commit is contained in:
@@ -16,7 +16,6 @@ class BookManager {
|
|||||||
|
|
||||||
if (keySplit.length == 2 && keySplit[0] == 'bmMeta') {
|
if (keySplit.length == 2 && keySplit[0] == 'bmMeta') {
|
||||||
let meta = await localForage.getItem(key);
|
let meta = await localForage.getItem(key);
|
||||||
meta.data = await localForage.getItem(`bmData-${keySplit[1]}`);
|
|
||||||
|
|
||||||
this.books[meta.key] = meta;
|
this.books[meta.key] = meta;
|
||||||
}
|
}
|
||||||
@@ -71,6 +70,10 @@ class BookManager {
|
|||||||
meta.key = this.keyFromUrl(meta.url);
|
meta.key = this.keyFromUrl(meta.url);
|
||||||
result = this.books[meta.key];
|
result = this.books[meta.key];
|
||||||
|
|
||||||
|
if (result && !result.data) {
|
||||||
|
result.data = await localForage.getItem(`bmData-${meta.key}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (result && !result.parsed) {
|
if (result && !result.parsed) {
|
||||||
result = await this.parseBook(result, result.data, callback);
|
result = await this.parseBook(result, result.data, callback);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user