rithik-b / PlaylistManager

Playlist loading and organization mod for Beat Saber.
GNU General Public License v3.0
101 stars 25 forks source link

Account for MAX_PATH when extracting songs #37

Closed Meivyn closed 2 years ago

Meivyn commented 2 years ago

This is going to throw an exception if entryPath exceeds MAX_PATH, which is around 255-260 characters on Windows.

https://github.com/rithik-b/PlaylistManager/blob/e39fe6559f98366396b9f71bace5566229d62c32/PlaylistManager/Utilities/DownloaderUtils.cs#L163-L168

image

@Top-Cat will probably limit the song name/author fields on BeatSaver, but I am opening an issue just in case.

Top-Cat commented 2 years ago

I don't think it would be a bad idea to limit the folder names anyway in PlaylistManager/BeatSaverDownloader

If you have a song name like "An artifice (that would have disrupted the far old monarchy in the course of time)" do you really need to have all that in the folder name? It's unlikely that people would actually be able to read all of that in file explorer.

rithik-b commented 2 years ago

Alright with some thinking on this situation here is what I propose Since this is max path, and we get not much control on where the user places their beat saber folder (the upper directories could have long names) I propose to limit the folder name to 50 characters (which seems to be the upper limit of something glanceable in file explorer) If we go above 260 still, user issue