mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-23 20:29:37 +00:00
Fix watcher scanner detecting existing items
This commit is contained in:
parent
f02992dd4d
commit
934c0b9093
2 changed files with 19 additions and 4 deletions
|
|
@ -448,10 +448,10 @@ class LibraryScanner {
|
|||
const itemGroupingResults = {}
|
||||
for (const itemDir in fileUpdateGroup) {
|
||||
const fullPath = Path.posix.join(fileUtils.filePathToPOSIX(folder.path), itemDir)
|
||||
const dirIno = await fileUtils.getIno(fullPath)
|
||||
|
||||
const itemDirParts = itemDir.split('/').slice(0, -1)
|
||||
const potentialChildDirs = []
|
||||
|
||||
const potentialChildDirs = [fullPath]
|
||||
for (let i = 0; i < itemDirParts.length; i++) {
|
||||
potentialChildDirs.push(Path.posix.join(fileUtils.filePathToPOSIX(folder.path), itemDir.split('/').slice(0, -1 - i).join('/')))
|
||||
}
|
||||
|
|
@ -462,6 +462,7 @@ class LibraryScanner {
|
|||
})
|
||||
|
||||
if (!existingLibraryItem) {
|
||||
const dirIno = await fileUtils.getIno(fullPath)
|
||||
existingLibraryItem = await Database.libraryItemModel.findOneOld({
|
||||
ino: dirIno
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue