aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/Migrations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-10-13 12:52:27 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-10-13 12:52:27 -0400
commit21c9f6e75eed6f5fb653a52ecbe3bea24146e2f1 (patch)
tree6717a3c91e3d7e245e524fb3b4d9863adcad7a42 /MediaBrowser.Server.Startup.Common/Migrations
parent61e6dd9b2f2cc17e8be9208070ff3e613d0e69ab (diff)
update chapters
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/Migrations')
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs46
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs36
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs41
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/RenameXbmcOptions.cs56
4 files changed, 0 insertions, 179 deletions
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;
- }
- }
-}