aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/Migrations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/Migrations')
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs11
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs9
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/MigrateUserFolders.cs9
3 files changed, 19 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs
index 8fe841ffc..166c2627f 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 ce4665b26..afdd4e623 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 5e3df5701..cb566d6cf 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)