Invalid charaters in file names
Johni0702 opened this issue · 1 comments
BeatSync removes invalid characters (as reported by Path.GetInvalidFileNameChars
) from file names:
BeatSync/BeatSyncLib/Utilities/Util.cs
Line 248 in b9b7e9a
However, it appears like the set of characters reported on Linux is different than the one reported on Windows (which makes sense), so BeatSync will create song folders with names including e.g. "
, |
, :
and *
(these are just the ones I noticed, not sure which ones exactly are the problematic ones and there are most certainly more).
This is all fine until one tries to start BeatSaber (via wine, so windows file name restrictions apply) where SongCore will then trigger an exception somewhere in the directory enumeration code and therefore end up loading 0 songs total.
I've got no idea how to best solve this. The simplest fix would probably be to just never use the song name in the folder name on Linux (if I understand correctly, that's just there for humans looking at that folder, and tbh I've never had the need to do that till today). Or restricting them to [a-zA-Z0-9]
, which should still give good results for a significant chunk of songs.
What I'll probably do is just make my own array of invalid characters with ones from both.