Добавлен запрос на объединение позиций при

обнаружении похожего файла в загруженных
This commit is contained in:
Book Pauk
2022-07-10 19:54:00 +07:00
parent 25cad81c50
commit 33fc553c55
2 changed files with 45 additions and 5 deletions

View File

@@ -499,8 +499,23 @@ class BookManager {
for (const key in this.recent) {
const book = this.recent[key];
if (!book.deleted && book.url == url && book.addTime > max) {
max = book.addTime;
if (!book.deleted && book.url == url && book.touchTime > max) {
max = book.touchTime;
result = book;
}
}
return result;
}
findRecentBySameBookKey(sameKey) {
let max = 0;
let result = null;
for (const key in this.recent) {
const book = this.recent[key];
if (!book.deleted && book.sameBookKey == sameKey && book.touchTime > max) {
max = book.touchTime;
result = book;
}
}