Batch author numBooks updates at scan end via authors_num_books_updated

This commit is contained in:
mikiher 2026-07-10 17:37:31 +03:00
parent 7ee5e1bdf6
commit 9d9ab49664
6 changed files with 75 additions and 17 deletions

View file

@ -234,8 +234,7 @@ class LibraryScanner {
SocketAuthority.libraryItemsEmitter('items_updated', libraryItemsUpdated)
}
// Authors and series that were removed from books should be removed if they are now empty
await LibraryItemScanner.checkAuthorsAndSeriesRemovedFromBooks(libraryScan.libraryId, libraryScan)
if (this.shouldCancelScan(libraryScan)) return true
// Update missing library items
if (libraryItemIdsMissing.length) {
@ -281,6 +280,9 @@ class LibraryScanner {
}
}
// Author book count updates and empty authors/series cleanup after all items are processed
await LibraryItemScanner.finalizeAuthorsAndSeriesFromScan(libraryScan.libraryId, libraryScan)
libraryScan.addLog(LogLevel.INFO, `Scan completed. ${libraryScan.resultStats}`)
return false
}