Skip to content

Commit

Permalink
Merge pull request #174 from rithik-b/master
Browse files Browse the repository at this point in the history
Removed playlist path code
  • Loading branch information
halsafar authored Sep 26, 2021
2 parents f47717e + d75e5ae commit 875ac46
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions SongBrowserPlugin/DataAccess/Playlist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,12 @@ class Playlist

public static BeatSaberPlaylistsLib.Types.IPlaylist CreateNew(string playlistName, IPreviewBeatmapLevel[] beatmapLevels)
{
string playlistFolderPath = defaultManager.PlaylistPath;
string playlistFileName = string.Join("_", playlistName.Replace("/", "").Replace("\\", "").Replace(".", "").Split(' '));
if (string.IsNullOrEmpty(playlistFileName))
{
playlistFileName = "playlist";
}
string playlistPath = Path.Combine(playlistFolderPath, playlistFileName + ".blist");
string originalPlaylistPath = Path.Combine(playlistFolderPath, playlistFileName);
int dupNum = 0;
while (File.Exists(playlistPath))
{
dupNum++;
playlistPath = originalPlaylistPath + string.Format("({0}).blist", dupNum);
playlistFileName += string.Format("({0})", dupNum);
}

BeatSaberPlaylistsLib.Types.IPlaylist playlist = defaultManager.CreatePlaylist(playlistFileName, playlistName, "SongBrowser", "");
BeatSaberPlaylistsLib.Types.IPlaylist playlist = defaultManager.CreatePlaylist("", playlistName, "SongBrowser", "");
foreach (var beatmapLevel in beatmapLevels)
{
playlist.Add(beatmapLevel);
}
defaultManager.StorePlaylist(playlist);
playlist.SuggestedExtension = defaultManager.DefaultHandler?.DefaultExtension;
return playlist;
}
}
Expand Down

0 comments on commit 875ac46

Please sign in to comment.