mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-21 19:34:43 +02:00
Update libraryFolderID correctly in scanFolderUpdates
This commit is contained in:
parent
9511122bae
commit
1bee082720
2 changed files with 11 additions and 9 deletions
|
@ -525,7 +525,7 @@ class LibraryScanner {
|
|||
path: potentialChildDirs
|
||||
})
|
||||
|
||||
let renamedPaths = {}
|
||||
let updatedLibraryItemDetails = {}
|
||||
if (!existingLibraryItem) {
|
||||
const dirIno = await fileUtils.getIno(fullPath)
|
||||
existingLibraryItem = await Database.libraryItemModel.findOneOld({
|
||||
|
@ -536,8 +536,9 @@ class LibraryScanner {
|
|||
// Update library item paths for scan
|
||||
existingLibraryItem.path = fullPath
|
||||
existingLibraryItem.relPath = itemDir
|
||||
renamedPaths.path = fullPath
|
||||
renamedPaths.relPath = itemDir
|
||||
updatedLibraryItemDetails.path = fullPath
|
||||
updatedLibraryItemDetails.relPath = itemDir
|
||||
updatedLibraryItemDetails.libraryFolderId = folder.id
|
||||
}
|
||||
}
|
||||
if (existingLibraryItem) {
|
||||
|
@ -557,7 +558,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, renamedPaths)
|
||||
itemGroupingResults[itemDir] = await LibraryItemScanner.scanLibraryItem(existingLibraryItem.id, updatedLibraryItemDetails)
|
||||
continue
|
||||
} else if (library.settings.audiobooksOnly && !hasAudioFiles(fileUpdateGroup, itemDir)) {
|
||||
Logger.debug(`[LibraryScanner] Folder update for relative path "${itemDir}" has no audio files`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue