mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-12 18:35:00 +02:00
Fix scanner after deleting single file books #4459
This commit is contained in:
parent
4102ed8be4
commit
df1391d93f
3 changed files with 11 additions and 1 deletions
|
@ -206,6 +206,11 @@ class LibraryItemScanner {
|
||||||
async scanPotentialNewLibraryItem(libraryItemPath, library, folder, isSingleMediaItem) {
|
async scanPotentialNewLibraryItem(libraryItemPath, library, folder, isSingleMediaItem) {
|
||||||
const libraryItemScanData = await this.getLibraryItemScanData(libraryItemPath, library, folder, isSingleMediaItem)
|
const libraryItemScanData = await this.getLibraryItemScanData(libraryItemPath, library, folder, isSingleMediaItem)
|
||||||
|
|
||||||
|
if (!libraryItemScanData.libraryFiles.length) {
|
||||||
|
Logger.info(`[LibraryItemScanner] Library item at path "${libraryItemPath}" has no files - ignoring`)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
const scanLogger = new ScanLogger()
|
const scanLogger = new ScanLogger()
|
||||||
scanLogger.verbose = true
|
scanLogger.verbose = true
|
||||||
scanLogger.setData('libraryItem', libraryItemScanData.relPath)
|
scanLogger.setData('libraryItem', libraryItemScanData.relPath)
|
||||||
|
|
|
@ -606,6 +606,11 @@ class LibraryScanner {
|
||||||
} else if (library.settings.audiobooksOnly && !hasAudioFiles(fileUpdateGroup, itemDir)) {
|
} else if (library.settings.audiobooksOnly && !hasAudioFiles(fileUpdateGroup, itemDir)) {
|
||||||
Logger.debug(`[LibraryScanner] Folder update for relative path "${itemDir}" has no audio files`)
|
Logger.debug(`[LibraryScanner] Folder update for relative path "${itemDir}" has no audio files`)
|
||||||
continue
|
continue
|
||||||
|
} else if (!(await fs.pathExists(fullPath))) {
|
||||||
|
Logger.info(`[LibraryScanner] File update group "${itemDir}" does not exist - ignoring`)
|
||||||
|
|
||||||
|
itemGroupingResults[itemDir] = ScanResult.NOTHING
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if a library item is a subdirectory of this dir
|
// Check if a library item is a subdirectory of this dir
|
||||||
|
|
|
@ -109,7 +109,7 @@ function getIno(path) {
|
||||||
.stat(path, { bigint: true })
|
.stat(path, { bigint: true })
|
||||||
.then((data) => String(data.ino))
|
.then((data) => String(data.ino))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
Logger.error('[Utils] Failed to get ino for path', path, err)
|
Logger.warn(`[Utils] Failed to get ino for path "${path}"`, err)
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue