rithik-b / PlaylistManager

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

Unzipping Bug #44

Closed Zingabopp closed 2 years ago

Zingabopp commented 2 years ago

When unzipping, PlaylistManager goes through all entries and unzips the files to the song's base directory. If a song has an autosaves folder it will overwrite the good files with files from autosaves.

Example: https://na.cdn.beatsaver.com/b7da8742e3ef95126dc53a9209d2d15403ab0563.zip Info.dat gets overwritten with an old version that lists the audio file as thereal.ogg

Meivyn commented 2 years ago

Following of https://github.com/Kylemc1413/SongCore/issues/79

rithik-b commented 2 years ago

It is the same for BeatSaverDownloader too, apparently it was done to protect from zip bombs Do you know how to do about this without zip bombs?

rithik-b commented 2 years ago

https://github.com/Kylemc1413/BeatSaverDownloader/blob/23396cf5deb2a4629e9e2a27573e4949d14787da/BeatSaverDownloader/Misc/SongDownloader.cs#L105 Line in question

Zingabopp commented 2 years ago

i did this for mine:


foreach (ZipArchiveEntry? entry in zipArchive.Entries.OrderByDescending(e => e.Length))
                    {
                        if (!entry.FullName.Equals(entry.Name)) // If false, the entry is a directory or file nested in one
                            continue;```
rithik-b commented 2 years ago

Ah, simple fix! Thank you, I will fix this