From d8d5dd487326dd3fccf4e9f30cd8f7e3783fcfda Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 12 Jan 2015 22:46:44 -0500 Subject: make channel access opt-in rather than opt out --- .../Migrations/DeleteDlnaProfiles.cs | 11 +++++++---- .../Migrations/DeprecatePlugins.cs | 9 ++++++--- .../Migrations/MigrateUserFolders.cs | 9 ++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Startup.Common/Migrations') diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs index 8fe841ffce..166c2627f1 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller; +using MediaBrowser.Common.IO; +using MediaBrowser.Controller; using System.IO; namespace MediaBrowser.Server.Startup.Common.Migrations @@ -6,10 +7,12 @@ namespace MediaBrowser.Server.Startup.Common.Migrations public class DeleteDlnaProfiles : IVersionMigration { private readonly IServerApplicationPaths _appPaths; + private readonly IFileSystem _fileSystem; - public DeleteDlnaProfiles(IServerApplicationPaths appPaths) + public DeleteDlnaProfiles(IServerApplicationPaths appPaths, IFileSystem fileSystem) { _appPaths = appPaths; + _fileSystem = fileSystem; } public void Run() @@ -23,7 +26,7 @@ namespace MediaBrowser.Server.Startup.Common.Migrations { try { - File.Delete(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system", filename + ".xml")); + _fileSystem.DeleteFile(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system", filename + ".xml")); } catch { @@ -31,7 +34,7 @@ namespace MediaBrowser.Server.Startup.Common.Migrations } try { - File.Delete(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user", filename + ".xml")); + _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 index ce4665b26c..afdd4e623f 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller; +using MediaBrowser.Common.IO; +using MediaBrowser.Controller; using System.IO; namespace MediaBrowser.Server.Startup.Common.Migrations @@ -6,10 +7,12 @@ namespace MediaBrowser.Server.Startup.Common.Migrations public class DeprecatePlugins : IVersionMigration { private readonly IServerApplicationPaths _appPaths; + private readonly IFileSystem _fileSystem; - public DeprecatePlugins(IServerApplicationPaths appPaths) + public DeprecatePlugins(IServerApplicationPaths appPaths, IFileSystem fileSystem) { _appPaths = appPaths; + _fileSystem = fileSystem; } public void Run() @@ -21,7 +24,7 @@ namespace MediaBrowser.Server.Startup.Common.Migrations { try { - File.Delete(Path.Combine(_appPaths.PluginsPath, filename)); + _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 index 5e3df5701e..cb566d6cf8 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller; +using MediaBrowser.Common.IO; +using MediaBrowser.Controller; using System; using System.IO; using System.Linq; @@ -8,10 +9,12 @@ namespace MediaBrowser.Server.Startup.Common.Migrations public class MigrateUserFolders : IVersionMigration { private readonly IServerApplicationPaths _appPaths; + private readonly IFileSystem _fileSystem; - public MigrateUserFolders(IServerApplicationPaths appPaths) + public MigrateUserFolders(IServerApplicationPaths appPaths, IFileSystem fileSystem) { _appPaths = appPaths; + _fileSystem = fileSystem; } public void Run() @@ -25,7 +28,7 @@ namespace MediaBrowser.Server.Startup.Common.Migrations foreach (var folder in folders) { - Directory.Delete(folder.FullName, true); + _fileSystem.DeleteDirectory(folder.FullName, true); } } catch (IOException) -- cgit v1.2.3