diff --git a/SongBrowserPlugin/DataAccess/SongBrowserSettings.cs b/SongBrowserPlugin/DataAccess/SongBrowserSettings.cs index a08808f..dc41380 100644 --- a/SongBrowserPlugin/DataAccess/SongBrowserSettings.cs +++ b/SongBrowserPlugin/DataAccess/SongBrowserSettings.cs @@ -49,6 +49,7 @@ public class SongBrowserSettings public bool folderSupportEnabled = false; public bool randomInstantQueue = false; + public bool deleteNumberedSongFolder = true; [NonSerialized] private static Logger Log = new Logger("SongBrowserSettings"); diff --git a/SongBrowserPlugin/Plugin.cs b/SongBrowserPlugin/Plugin.cs index 4b92b3d..4e5dcd7 100644 --- a/SongBrowserPlugin/Plugin.cs +++ b/SongBrowserPlugin/Plugin.cs @@ -13,7 +13,7 @@ public string Name public string Version { - get { return "v2.2.5"; } + get { return "v2.2.6"; } } public void OnApplicationStart() diff --git a/SongBrowserPlugin/UI/Browser/SongBrowserUI.cs b/SongBrowserPlugin/UI/Browser/SongBrowserUI.cs index f080fbb..3e3dfd5 100644 --- a/SongBrowserPlugin/UI/Browser/SongBrowserUI.cs +++ b/SongBrowserPlugin/UI/Browser/SongBrowserUI.cs @@ -579,16 +579,19 @@ public void HandleDeleteDialogPromptViewControllerDidFinish(SimpleDialogPromptVi } // check if this is in the BeatSaberDownloader format - String[] splitPath = songPath.Split('/'); - if (splitPath.Length > 2) - { - String numberedDir = splitPath[splitPath.Length - 2]; - Regex r = new Regex(@"^\d{1,}-\d{1,}"); - if (r.Match(numberedDir).Success) + if (_model.Settings.deleteNumberedSongFolder) + { + String[] splitPath = songPath.Split('/'); + if (splitPath.Length > 2) { - DirectoryInfo songNumberedDirPath = Directory.GetParent(songPath); - _log.Debug("Deleting song numbered folder: {0}", songNumberedDirPath.FullName); - Directory.Delete(songNumberedDirPath.FullName, true); + String numberedDir = splitPath[splitPath.Length - 2]; + Regex r = new Regex(@"^\d{1,}-\d{1,}"); + if (r.Match(numberedDir).Success) + { + DirectoryInfo songNumberedDirPath = Directory.GetParent(songPath); + _log.Debug("Deleting song numbered folder: {0}", songNumberedDirPath.FullName); + Directory.Delete(songNumberedDirPath.FullName, true); + } } } }