Работа над BookUpdateChecker

This commit is contained in:
Book Pauk
2022-07-27 15:40:46 +07:00
parent a1fcb7597b
commit 7f17e7daed
6 changed files with 109 additions and 31 deletions

View File

@@ -487,6 +487,28 @@ class BookManager {
await this.recentSetItem(item);
}
async setCheckBuc(value, checkBuc = true) {
const item = this.recent[value.key];
const updateItems = [];
if (item) {
if (item.sameBookKey !== undefined) {
const sorted = this.getSortedRecent();
for (const book of sorted) {
if (book.sameBookKey === item.sameBookKey)
updateItems.push(book);
}
} else {
updateItems.push(item);
}
}
for (const book of updateItems) {
book.checkBuc = checkBuc;
await this.recentSetItem(book);
}
}
async cleanRecentBooks() {
const sorted = this.getSortedRecent();