diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-13 12:52:27 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-13 12:52:27 -0400 |
| commit | 21c9f6e75eed6f5fb653a52ecbe3bea24146e2f1 (patch) | |
| tree | 6717a3c91e3d7e245e524fb3b4d9863adcad7a42 /MediaBrowser.Server.Startup.Common | |
| parent | 61e6dd9b2f2cc17e8be9208070ff3e613d0e69ab (diff) | |
update chapters
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
6 files changed, 1 insertions, 188 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index f24a3541b9..0f01e8aeae 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -351,11 +351,7 @@ namespace MediaBrowser.Server.Startup.Common { var migrations = new List<IVersionMigration> { - new MigrateUserFolders(ApplicationPaths, FileSystemManager), - new RenameXbmcOptions(ServerConfigurationManager), - new RenameXmlOptions(ServerConfigurationManager), - new DeprecatePlugins(ApplicationPaths, FileSystemManager), - new DeleteDlnaProfiles(ApplicationPaths, FileSystemManager) + new RenameXmlOptions(ServerConfigurationManager) }; foreach (var task in migrations) diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index e1eccdc321..9def89073b 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -71,11 +71,7 @@ <Compile Include="FFMpeg\FFmpegValidator.cs" /> <Compile Include="INativeApp.cs" /> <Compile Include="MbLinkShortcutHandler.cs" /> - <Compile Include="Migrations\DeleteDlnaProfiles.cs" /> - <Compile Include="Migrations\DeprecatePlugins.cs" /> <Compile Include="Migrations\IVersionMigration.cs" /> - <Compile Include="Migrations\MigrateUserFolders.cs" /> - <Compile Include="Migrations\RenameXbmcOptions.cs" /> <Compile Include="Migrations\RenameXmlOptions.cs" /> <Compile Include="NativeEnvironment.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs deleted file mode 100644 index 7b61522202..0000000000 --- a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs +++ /dev/null @@ -1,46 +0,0 @@ -using MediaBrowser.Common.IO; -using MediaBrowser.Controller; -using System.IO; -using CommonIO; - -namespace MediaBrowser.Server.Startup.Common.Migrations -{ - public class DeleteDlnaProfiles : IVersionMigration - { - private readonly IServerApplicationPaths _appPaths; - private readonly IFileSystem _fileSystem; - - public DeleteDlnaProfiles(IServerApplicationPaths appPaths, IFileSystem fileSystem) - { - _appPaths = appPaths; - _fileSystem = fileSystem; - } - - public void Run() - { - RemoveProfile("Android"); - RemoveProfile("Windows Phone"); - RemoveProfile("Windows 8 RT"); - } - - private void RemoveProfile(string filename) - { - try - { - _fileSystem.DeleteFile(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system", filename + ".xml")); - } - catch - { - - } - try - { - _fileSystem.DeleteFile(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user", filename + ".xml")); - } - catch - { - - } - } - } -} diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs b/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs deleted file mode 100644 index a7f1d332eb..0000000000 --- a/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs +++ /dev/null @@ -1,36 +0,0 @@ -using MediaBrowser.Common.IO; -using MediaBrowser.Controller; -using System.IO; -using CommonIO; - -namespace MediaBrowser.Server.Startup.Common.Migrations -{ - public class DeprecatePlugins : IVersionMigration - { - private readonly IServerApplicationPaths _appPaths; - private readonly IFileSystem _fileSystem; - - public DeprecatePlugins(IServerApplicationPaths appPaths, IFileSystem fileSystem) - { - _appPaths = appPaths; - _fileSystem = fileSystem; - } - - public void Run() - { - RemovePlugin("MediaBrowser.Plugins.LocalTrailers.dll"); - } - - private void RemovePlugin(string filename) - { - try - { - _fileSystem.DeleteFile(Path.Combine(_appPaths.PluginsPath, filename)); - } - catch - { - - } - } - } -} diff --git a/MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs b/MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs deleted file mode 100644 index 4a40090f06..0000000000 --- a/MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs +++ /dev/null @@ -1,41 +0,0 @@ -using MediaBrowser.Common.IO; -using MediaBrowser.Controller; -using System; -using System.IO; -using System.Linq; -using CommonIO; - -namespace MediaBrowser.Server.Startup.Common.Migrations -{ - public class MigrateUserFolders : IVersionMigration - { - private readonly IServerApplicationPaths _appPaths; - private readonly IFileSystem _fileSystem; - - public MigrateUserFolders(IServerApplicationPaths appPaths, IFileSystem fileSystem) - { - _appPaths = appPaths; - _fileSystem = fileSystem; - } - - public void Run() - { - try - { - var rootPath = _appPaths.RootFolderPath; - - var folders = _fileSystem.GetDirectories(rootPath) - .Where(i => !string.Equals(i.Name, "default", StringComparison.OrdinalIgnoreCase)) - .ToList(); - - foreach (var folder in folders) - { - _fileSystem.DeleteDirectory(folder.FullName, true); - } - } - catch (IOException) - { - } - } - } -} diff --git a/MediaBrowser.Server.Startup.Common/Migrations/RenameXbmcOptions.cs b/MediaBrowser.Server.Startup.Common/Migrations/RenameXbmcOptions.cs deleted file mode 100644 index 02b0f9a0ab..0000000000 --- a/MediaBrowser.Server.Startup.Common/Migrations/RenameXbmcOptions.cs +++ /dev/null @@ -1,56 +0,0 @@ -using MediaBrowser.Controller.Configuration; -using System; - -namespace MediaBrowser.Server.Startup.Common.Migrations -{ - public class RenameXbmcOptions : IVersionMigration - { - private readonly IServerConfigurationManager _config; - - public RenameXbmcOptions(IServerConfigurationManager config) - { - _config = config; - } - - public void Run() - { - var changed = false; - - foreach (var option in _config.Configuration.MetadataOptions) - { - if (Migrate(option.DisabledMetadataSavers)) - { - changed = true; - } - if (Migrate(option.LocalMetadataReaderOrder)) - { - changed = true; - } - } - - if (changed) - { - _config.SaveConfiguration(); - } - } - - private bool Migrate(string[] options) - { - var changed = false; - - if (options != null) - { - for (var i = 0; i < options.Length; i++) - { - if (string.Equals(options[i], "Xbmc Nfo", StringComparison.OrdinalIgnoreCase)) - { - options[i] = "Nfo"; - changed = true; - } - } - } - - return changed; - } - } -} |
