diff options
| author | Vasily <JustAMan@users.noreply.github.com> | 2019-01-29 16:50:01 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-29 16:50:01 +0300 |
| commit | 8487319374fa86601a6fcfdae64ee75dc51ed357 (patch) | |
| tree | 919d0ccc8d36793bcd20dfe58c48563ea724f0e3 /MediaBrowser.Api/Library/LibraryStructureService.cs | |
| parent | 0e2e7311036187342fd33d2eb745df4a6bece3f4 (diff) | |
| parent | 91e99effc9b8dd1e34d4e53e732fe71f1423006c (diff) | |
Merge pull request #726 from EraYaN/remove-wrappers-for-system-io
Clean up IFileSystem wrappers around stdlib.
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryStructureService.cs | 8 |
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 { |
