Skip to content

fix(Import): case-fold media filenames when checking uniqueness#4435

Merged
abdnh merged 8 commits intoankitects:mainfrom
iamllama:import-media-case-insensitive
Nov 20, 2025
Merged

fix(Import): case-fold media filenames when checking uniqueness#4435
abdnh merged 8 commits intoankitects:mainfrom
iamllama:import-media-case-insensitive

Conversation

@iamllama
Copy link
Copy Markdown
Contributor

Fixes #4433

The fix proposed is to compare media filenames case-insensitively on windows only. Initially set it to case-fold all the time as i thought case-sensitivity was a filesystem property, but it seems windows allows per-directory case-sensitivity (still problematic as win32 programs usually expect case insensitive filenames)

Perhaps we could test for this at startup by touching two files whose names only differ by case and using same-file to check if they're considered the same in the media folder

@iamllama iamllama marked this pull request as ready for review November 18, 2025 14:22
@yclee126
Copy link
Copy Markdown

MacOS APFS is also case-insensitive by default, wouldn't it be better to always case-fold? Syncing between different filesystems could be a problem too.

@iamllama
Copy link
Copy Markdown
Contributor Author

iamllama commented Nov 19, 2025

Syncing between different filesystems could be a problem too.

Doesn't seem like it'd be easy to handle this retroactively (there's already some normalisation when syncing but it doesn't update media references afaict), will look into it. Maybe it can be done during Check Database

For now i've added a change to case-fold when adding new media for consistency

Comment thread rslib/src/media/files.rs Outdated
@abdnh abdnh merged commit 5614d20 into ankitects:main Nov 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Importer overwrites existing media files with different letter cases

3 participants