Change case leads to duplicates
I just changed the name of a directory (where I have music) from "x" to "X" (example). lms now thinks that everything in X is a duplicate of everything in x, even though x doesn't exist anymore.
It looks like it might be doing a case-sensitive search for new songs, but a case-insensitive check to see if old songs exist?
Hello, Ah, this reminds me something. Do you use a cifs share?
Actually yes, I do! Kind of forgot, because it's all working in the background without me having to think about it much. The server is running Linux (TrueNAS), but the whole dataset is case-insensitive for Windows clients. What threw me off was the fact that lms seemed to mix sensitivity and insensitivity for the two different processes.
Lms is always case sensitive. When discovering new files, the new case is used to register the new files in the db. But old files in the db are later checked, and since the FS is case insensitive, lms considers files are still here.
Ah so I guess lms just asks if this file exists, and the file system says yes. Can lms determine if x/song.mp3 and X/song.mp3 lead to the same file, when it notices two paths only differing by case? Or just get a list of all files on the file system during scanning and notice that x/song.mp3 is missing?
Lms cannot save all the paths in memory at once. It has to work on low end devices and it must handle millions of files. Therefore, all operations are split in chunks. There may be other solutions, but they all come with some perf penality / code complexity increase. Can't you just make your server force case sensitivity?
That would first create more work, as I can't use the SMB preset, and also I'd have to recreate a 20TB dataset. Then, I might run into issues in the future, with both Windows and Mac clients being case insensitive - in two ways: when accessing the share, and because I'm Syncthinging stuff to Windows computers.
Was just thinking there could be a built-in solution as well. Another idea is to proceed with the scan as before, but in the end, it obviously knows about duplicates. You could then check if the duplicates only differ by case, and if so, do some further checks to determine if they both do exist as separate entries.
But it's not a big deal to me, as I can just rename to something else first, scan, rename back to the case I wanted, and rescan. As long as I made you aware of it, I'm fine with you deciding to leave it be to preserve more important aspects of the software =).