Fix: Scanner check path and inode value for removed books, scanner v5 outlined

This commit is contained in:
advplyr 2021-11-22 19:58:20 -06:00
parent ea366c00ca
commit 3fa0fe4b64
12 changed files with 553 additions and 7 deletions

View file

@ -454,7 +454,6 @@ class Scanner {
var audiobooksInLibrary = this.db.audiobooks.filter(ab => ab.libraryId === libraryId)
// TODO: This temporary fix from pre-release should be removed soon, "checkUpdateInos"
// TEMP - update ino for each audiobook
if (audiobooksInLibrary.length) {
for (let i = 0; i < audiobooksInLibrary.length; i++) {
var ab = audiobooksInLibrary[i]
@ -463,7 +462,7 @@ class Scanner {
if (shouldUpdateIno) {
var filesWithMissingIno = ab.getFilesWithMissingIno()
Logger.debug(`\n\Updating inos for "${ab.title}"`)
Logger.debug(`\nUpdating inos for "${ab.title}"`)
Logger.debug(`In Scan, Files with missing inode`, filesWithMissingIno)
var hasUpdates = await ab.checkUpdateInos()
@ -504,7 +503,7 @@ class Scanner {
// Check for removed audiobooks
for (let i = 0; i < audiobooksInLibrary.length; i++) {
var audiobook = audiobooksInLibrary[i]
var dataFound = audiobookDataFound.find(abd => abd.ino === audiobook.ino)
var dataFound = audiobookDataFound.find(abd => abd.ino === audiobook.ino || comparePaths(abd.path, audiobook.path))
if (!dataFound) {
Logger.info(`[Scanner] Audiobook "${audiobook.title}" is missing`)
audiobook.isMissing = true