private void RemoveUnsubscribedConvertedModpackMusic() { Debug.Log("[CSLMusic] Removing unsubscribed converted music files ..."); List <String> dirstoremove = new List <string>(); if (Directory.Exists(ConvertedMusicPackMusicFolder)) { dirstoremove.AddRange(Directory.GetDirectories(ConvertedMusicPackMusicFolder)); } //Look through folders and look if pluginid exists foreach (String folder in dirstoremove.ToArray()) { String foldername = Path.GetFileName(folder); String modid = foldername.TrimStart('_'); if (ModHelper.PluginIdExists(modid)) { dirstoremove.Remove(folder); } } //Delete all which are left foreach (String folder in dirstoremove) { Debug.Log("[CSLMusic] ... deleting " + folder); Directory.Delete(folder, true); } }