aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryStructureService.cs
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-26 22:59:53 +0100
committerErwin de Haan <EraYaN@users.noreply.github.com>2019-01-28 22:10:00 +0100
commit581a7fe078002785b9ba628ec139a42d678cdf25 (patch)
treeab536538f4af5293300f8003e964e0828cb320c8 /MediaBrowser.Api/Library/LibraryStructureService.cs
parenta430568082b55f2f989924c59e0729808b39226c (diff)
Unwrapped `MoveDirectory`, `DirectoryExists`, `FileExists` & removed `MoveFile`
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index 3be6b29dd..c95a06805 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -255,12 +255,12 @@ namespace MediaBrowser.Api.Library
var currentPath = Path.Combine(rootFolderPath, request.Name);
var newPath = Path.Combine(rootFolderPath, request.NewName);
- if (!_fileSystem.DirectoryExists(currentPath))
+ if (Directory.Exists(currentPath))
{
throw new FileNotFoundException("The media collection does not exist");
}
- if (!string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase) && _fileSystem.DirectoryExists(newPath))
+ if (!string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase) && Directory.Exists(newPath))
{
throw new ArgumentException("Media library already exists at " + newPath + ".");
}
@@ -273,11 +273,11 @@ namespace MediaBrowser.Api.Library
if (string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase))
{
var tempPath = Path.Combine(rootFolderPath, Guid.NewGuid().ToString("N"));
- _fileSystem.MoveDirectory(currentPath, tempPath);
+ Directory.Move(currentPath, tempPath);
currentPath = tempPath;
}
- _fileSystem.MoveDirectory(currentPath, newPath);
+ Directory.Move(currentPath, newPath);
}
finally
{