Create Playlists folder if it doesn't exist

This commit is contained in:
Megalon 2020-06-29 10:56:01 -07:00
parent c170d91d26
commit 58de249f1d
2 changed files with 10 additions and 5 deletions

View file

@ -69,6 +69,8 @@ namespace ModAssistant
}
}
API.Playlists.CreatePlaylistsFolder();
options.InstallType =
BeatSaberInstallType = ModAssistant.Properties.Settings.Default.StoreType;
options.SaveSelection =

View file

@ -12,12 +12,15 @@ namespace ModAssistant.API
private const string BSaberURLPrefix = "https://bsaber.com/PlaylistAPI/";
private const string PlaylistsFolder = "Playlists";
private static readonly string BeatSaberPath = Utils.BeatSaberPath;
string root = App.BeatSaberInstallDirectory;
string subdir = PlaylistsFolder;
if (!Directory.Exists(subdir))
public static bool CreatePlaylistsFolder()
{
Directory.CreateDirectory(subdir);
string playlistsPath = Path.Combine(BeatSaberPath, PlaylistsFolder);
if (!Directory.Exists(playlistsPath))
{
Directory.CreateDirectory(playlistsPath);
}
return true;
}
public static async Task DownloadAll(Uri uri)