From 8a05d0e4a062b360b5045082939f573c0ae9e8bf Mon Sep 17 00:00:00 2001 From: Jack Baron Date: Thu, 22 Oct 2020 15:34:34 +0100 Subject: [PATCH] only create playlists dir when needed --- ModAssistant/App.xaml.cs | 2 -- ModAssistant/Classes/External Interfaces/Playlists.cs | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ModAssistant/App.xaml.cs b/ModAssistant/App.xaml.cs index 0afc691..989e063 100644 --- a/ModAssistant/App.xaml.cs +++ b/ModAssistant/App.xaml.cs @@ -69,8 +69,6 @@ namespace ModAssistant } } - API.Playlists.CreatePlaylistsFolder(); - options.InstallType = BeatSaberInstallType = ModAssistant.Properties.Settings.Default.StoreType; options.SaveSelection = diff --git a/ModAssistant/Classes/External Interfaces/Playlists.cs b/ModAssistant/Classes/External Interfaces/Playlists.cs index 2753522..c6d288d 100644 --- a/ModAssistant/Classes/External Interfaces/Playlists.cs +++ b/ModAssistant/Classes/External Interfaces/Playlists.cs @@ -28,7 +28,6 @@ namespace ModAssistant.API string filename = await Get(url); await DownloadFrom(filename); break; - } } @@ -38,7 +37,9 @@ namespace ModAssistant.API string absolutePath = Path.Combine(BeatSaberPath, PlaylistsFolder, filename); try { + CreatePlaylistsFolder(); await Utils.DownloadAsset(url.ToString(), PlaylistsFolder, filename); + return absolutePath; } catch @@ -49,6 +50,8 @@ namespace ModAssistant.API public static async Task DownloadFrom(string file) { + CreatePlaylistsFolder(); + if (Path.Combine(BeatSaberPath, PlaylistsFolder) != Path.GetDirectoryName(file)) { string destination = Path.Combine(BeatSaberPath, PlaylistsFolder, Path.GetFileName(file));