This commit is contained in:
Luke Pulverenti
2014-10-20 16:23:40 -04:00
parent 3be4aa8dc7
commit 1292eccfb5
27 changed files with 827 additions and 600 deletions

View File

@@ -324,6 +324,41 @@ namespace MediaBrowser.ServerApplication
private void PerformVersionMigration()
{
DeleteDeprecatedModules();
if (!ServerConfigurationManager.Configuration.PlaylistImagesDeleted)
{
DeletePlaylistImages();
ServerConfigurationManager.Configuration.PlaylistImagesDeleted = true;
ServerConfigurationManager.SaveConfiguration();
}
}
private void DeletePlaylistImages()
{
try
{
var path = Path.Combine(ApplicationPaths.DataPath, "playlists");
var files = Directory.GetFiles(path, "*", SearchOption.AllDirectories)
.Where(i => BaseItem.SupportedImageExtensions.Contains(Path.GetExtension(i) ?? string.Empty))
.ToList();
foreach (var file in files)
{
try
{
File.Delete(file);
}
catch (IOException)
{
}
}
}
catch (IOException)
{
}
}
private void DeleteDeprecatedModules()