rithik-b / PlaylistManager

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

Duplicates due to BeatSaberDownloader and PlaylistManager naming being backwards? #49

Closed xtex404 closed 2 years ago

xtex404 commented 2 years ago

I may have figured out why I have a ton of duplicate songs in my CustomLevels folder -- one with Song-LevelAuthor, and one LevelAuthor-Song...

Looks like BeatSaverDownloader creates directory names based on songInfo.ID + " (" + songInfo.Metadata.SongName + " - " + songInfo.Metadata.LevelAuthorName + ")" (SongDownloader.cs:98), and PlaylistManager on song.ID + " (" + song.Metadata.LevelAuthorName + " - " + song.Metadata.SongName (PlaylistSequentialDownloader.cs:384).

Still.. I'm not exactly sure why this is happening in the first place, since it looks like neither should be downloading songs with duplicate hashes (and the files inside the duplicate folders are identical).. but I'm sure PlaylistManager is involved -- because the majority of the dupes appeared at the same time, and always with songs that were contained in playlists that were downloaded inside of Beat Saber and not externally via ModAssistant/etc. :-\

rithik-b commented 2 years ago

This was actually Top Cat's idea https://github.com/rithik-b/PlaylistManager/issues/37#issuecomment-982734379 And the song name was added to the end so it can be concatenated when necessary Would be better to open the issue on BeatSaverDownloader to have this change as well as top cat maintains it currently.

As for the duplicates, it might be through installing playlists via mod assistant as it doesn't run a hash check through your owned song library, and downloads levels as is, as long as it can overwrite existing song folders.

rithik-b commented 2 years ago

Have swapped it back in latest

xtex404 commented 2 years ago

Hah... thanks. :)

I'm still not sure where my dupes are coming from -- obviously something isn't hashing before it downloads, and I don't use MA for music installs.. one of these days I'll figure out who is misbehaving.

I ended up writing a python script that iterates through customlevels, hashes (used your code to figure out how that's done), and nukes dupes (making sure to only nuke the ones that don't have cinema configs/videos in them).. saved almost 4GB.

thanks for everything you do with this (and other) mods!