geigerzaehler / beets-alternatives

Beets plugin to manage external files
MIT License
91 stars 21 forks source link

Failure on case insensitive filesystem when case changes #66

Open aereaux opened 2 years ago

aereaux commented 2 years ago

I see this error when using this plugin on a case-insensitive filesystem (fat32):

Error: file exists while renaming /media/NIKON D3300/Music/classical/Henri Dutilleux; Cyril Ciabaud, Kasia Tomczak-Feltrin, Mathieu Petit, Romain Robine, Orchestre National de Lille, Jean‐Claude Casadesus/Symphony no. 1 _ Métaboles _ Les Citations/01 Symphony no. 1_ I. Passacaille_ Andante.opus to /media/NIKON D3300/Music/classical/Henri Dutilleux; Cyril Ciabaud, Kasia Tomczak-Feltrin, Mathieu Petit, Romain Robine, Orchestre national de Lille, Jean‐Claude Casadesus/Symphony no. 1 _ Métaboles _ Les Citations/01 Symphony no. 1_ I. Passacaille_ Andante.opus

The N in Orchestre National de Lille changed to lowercase, and that seems to be what's causing this problem.

wisp3rwind commented 2 years ago

I guess we would need to rename through a temporary file to avoid this. Anyone aware of a way to detect this issue such that we don't need to use a temp file unconditionally?

aereaux commented 2 years ago

Not entirely sure, I usually try to avoid case insensitive filesystems. I did find these two issues, though:

The second one uses beets.util.is_filesystem_case_sensitive which might work.