mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Fix:Scanner detecting library item folder renames #1161
This commit is contained in:
parent
cdd740015c
commit
c264332994
2 changed files with 8 additions and 4 deletions
|
@ -483,6 +483,7 @@ class LibraryScanner {
|
|||
path: potentialChildDirs
|
||||
})
|
||||
|
||||
let renamedPaths = {}
|
||||
if (!existingLibraryItem) {
|
||||
const dirIno = await fileUtils.getIno(fullPath)
|
||||
existingLibraryItem = await Database.libraryItemModel.findOneOld({
|
||||
|
@ -493,6 +494,8 @@ class LibraryScanner {
|
|||
// Update library item paths for scan
|
||||
existingLibraryItem.path = fullPath
|
||||
existingLibraryItem.relPath = itemDir
|
||||
renamedPaths.path = fullPath
|
||||
renamedPaths.relPath = itemDir
|
||||
}
|
||||
}
|
||||
if (existingLibraryItem) {
|
||||
|
@ -512,7 +515,7 @@ class LibraryScanner {
|
|||
|
||||
// Scan library item for updates
|
||||
Logger.debug(`[LibraryScanner] Folder update for relative path "${itemDir}" is in library item "${existingLibraryItem.media.metadata.title}" - scan for updates`)
|
||||
itemGroupingResults[itemDir] = await LibraryItemScanner.scanLibraryItem(existingLibraryItem.id)
|
||||
itemGroupingResults[itemDir] = await LibraryItemScanner.scanLibraryItem(existingLibraryItem.id, renamedPaths)
|
||||
continue
|
||||
} else if (library.settings.audiobooksOnly && !fileUpdateGroup[itemDir].some?.(scanUtils.checkFilepathIsAudioFile)) {
|
||||
Logger.debug(`[LibraryScanner] Folder update for relative path "${itemDir}" has no audio files`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue