mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(scanner): resolve case-insensitive path identity to prevent duplicate books
When library items are scanned or moved on case-insensitive filesystems, paths with non-standard author or folder capitalization point to the same physical disk entries. Treating previous path spellings as distinct caused scanner, upload, dock, and rename services to fail path-reuse lookups and create duplicate book records. Introduce path identity helpers to check whether paths resolve to the same underlying filesystem entry, treating matching entries as path updates rather than creating duplicate books. Closes #1012
This commit is contained in:
@@ -151,6 +151,23 @@ const structuralScenarios: StructuralScenario[] = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'manual-case-only-author-folder-rename',
|
||||
trigger: 'manual',
|
||||
libraries: [{ key: 'a', rootDir: 'lib-a', mode: 'book_per_folder' }],
|
||||
entries: [file('lib-a/Bell Hooks/Book/book.epub')],
|
||||
operations: [{ type: 'move', from: 'lib-a/Bell Hooks', to: 'lib-a/bell hooks' }],
|
||||
expected: {
|
||||
a: {
|
||||
statusByFolder: { 'bell hooks/Book': 'present' },
|
||||
absentFolders: ['Bell Hooks/Book'],
|
||||
fileOwners: { 'bell hooks/Book/book.epub': 'bell hooks/Book' },
|
||||
presentCount: 1,
|
||||
missingCount: 0,
|
||||
},
|
||||
},
|
||||
requiresCaseRename: true,
|
||||
},
|
||||
{
|
||||
id: 'manual-move-root-file-into-subfolder',
|
||||
trigger: 'manual',
|
||||
|
||||
Reference in New Issue
Block a user