diff options
| author | Sven Van den brande <sven.vandenbrande@outlook.com> | 2014-11-11 23:15:20 +0100 |
|---|---|---|
| committer | Sven Van den brande <sven.vandenbrande@outlook.com> | 2014-11-11 23:15:20 +0100 |
| commit | cbd2c2fc5435aead30513150fc9f50c86eebde49 (patch) | |
| tree | 01d3a826de7a038acf31788488356980dab60d26 /MediaBrowser.Server.Startup.Common/ApplicationHost.cs | |
| parent | 4d0a47e5555e4b04967c679dd4e54e937a0bd7ca (diff) | |
| parent | 0dfac392e74c0c0688346eedf728eb4d68df68ec (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/ApplicationHost.cs')
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 83 |
1 files changed, 5 insertions, 78 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index c321b4c09..d8358909e 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -82,6 +82,7 @@ using MediaBrowser.Server.Implementations.Sync; using MediaBrowser.Server.Implementations.Themes; using MediaBrowser.Server.Implementations.TV; using MediaBrowser.Server.Startup.Common.FFMpeg; +using MediaBrowser.Server.Startup.Common.Migrations; using MediaBrowser.WebDashboard.Api; using MediaBrowser.XbmcMetadata.Providers; using System; @@ -322,84 +323,10 @@ namespace MediaBrowser.Server.Startup.Common 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() - { - try - { - MigrateUserFolders(); - } - catch (IOException) - { - } - - try - { - File.Delete(Path.Combine(ApplicationPaths.PluginsPath, "MBPhoto.dll")); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - File.Delete(Path.Combine(ApplicationPaths.PluginsPath, "MediaBrowser.Plugins.XbmcMetadata.dll")); - } - catch (IOException) - { - // Not there, no big deal - } - } - - private void MigrateUserFolders() - { - var rootPath = ApplicationPaths.RootFolderPath; - - var folders = new DirectoryInfo(rootPath).EnumerateDirectories("*", SearchOption.TopDirectoryOnly).Where(i => !string.Equals(i.Name, "default", StringComparison.OrdinalIgnoreCase)) - .ToList(); - - foreach (var folder in folders) - { - Directory.Delete(folder.FullName, true); - } + new MigrateUserFolders(ApplicationPaths).Run(); + new PlaylistImages(ServerConfigurationManager).Run(); + new RenameXbmcOptions(ServerConfigurationManager).Run(); + new RenameXmlOptions(ServerConfigurationManager).Run(); } /// <summary> |
