Skip to content

Commit

Permalink
Merge pull request #51 from kinsi55/master
Browse files Browse the repository at this point in the history
Fix downloading of historical beatmap versions
  • Loading branch information
rithik-b authored May 30, 2022
2 parents 15b3c02 + a9cb4ef commit 23ba3e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions PlaylistManager/Downloaders/PlaylistSequentialDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ private async Task BeatmapDownloadByHash(string hash, CancellationToken token, I
}
else
{
var latest = song.LatestVersion;
await BeatmapDownloadByCustomURL(latest.DownloadURL.Replace(latest.Hash, hash.ToLowerInvariant()), FolderNameForBeatsaverMap(song), token, progress as IProgress<float>);
await BeatmapDownloadByCustomURL($"https://cdn.beatsaver.com/{hash.ToLowerInvariant()}.zip", FolderNameForBeatsaverMap(song), token, progress as IProgress<float>);
}
}
catch (Exception e)
Expand Down Expand Up @@ -381,7 +380,7 @@ private async Task BeatmapDownloadByCustomURL(string url, string songName, Cance
private string FolderNameForBeatsaverMap(Beatmap song)
{
// A workaround for the max path issue and long folder names
var longFolderName = song.ID + " (" + song.Metadata.LevelAuthorName + " - " + song.Metadata.SongName;
var longFolderName = song.ID + " (" + song.Metadata.SongName + " - " + song.Metadata.LevelAuthorName;
return longFolderName.Truncate(49, true) + ")";
}

Expand Down
2 changes: 1 addition & 1 deletion PlaylistManager/PlaylistManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<Private>False</Private>
</Reference>
<Reference Include="Polyglot, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Beat Saber\Beat Saber_Data\Managed\Polyglot.dll</HintPath>
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Polyglot.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion PlaylistManager/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "PlaylistManager",
"name": "PlaylistManager",
"author": "PixelBoom",
"version": "1.6.5",
"version": "1.6.6",
"description": [
"#![PlaylistManager.Description.md]",
"Load, Create, Edit, Organize Playlists and Download their Songs in Beat Saber."
Expand Down

0 comments on commit 23ba3e7

Please sign in to comment.