Изменение механизма хранения книг

This commit is contained in:
Book Pauk
2022-07-10 17:31:21 +07:00
parent c878ce432f
commit 5edeed0747
3 changed files with 10 additions and 9 deletions

View File

@@ -485,13 +485,13 @@ class BookManager {
return result;
}
findRecentByUrl(url) {
findRecentByUrlAndPath(url, bookPath) {
let max = 0;
let result = null;
for (const key in this.recent) {
const book = this.recent[key];
if (!book.deleted && book.url == url && book.addTime > max) {
if (!book.deleted && book.url == url && book.addTime > max && (!bookPath || book.path == bookPath)) {
max = book.addTime;
result = book;
}