Explorar o código

Unwrapped CreateDirectory and DeleteDirectory

Erwin de Haan %!s(int64=6) %!d(string=hai) anos
pai
achega
d7c6d16250
Modificáronse 58 ficheiros con 102 adicións e 101 borrados
  1. 2 2
      Emby.Dlna/DlnaManager.cs
  2. 1 1
      Emby.Drawing/ImageProcessor.cs
  3. 3 3
      Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
  4. 2 2
      Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
  5. 1 1
      Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
  6. 2 2
      Emby.Server.Implementations/Channels/ChannelManager.cs
  7. 2 2
      Emby.Server.Implementations/Collections/CollectionManager.cs
  8. 1 1
      Emby.Server.Implementations/Devices/DeviceId.cs
  9. 4 4
      Emby.Server.Implementations/Devices/DeviceManager.cs
  10. 1 1
      Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs
  11. 2 2
      Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
  12. 2 2
      Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
  13. 13 13
      Emby.Server.Implementations/Library/LibraryManager.cs
  14. 1 1
      Emby.Server.Implementations/Library/MediaSourceManager.cs
  15. 2 2
      Emby.Server.Implementations/Library/UserManager.cs
  16. 2 2
      Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs
  17. 2 2
      Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
  18. 1 1
      Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs
  19. 3 3
      Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
  20. 1 1
      Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs
  21. 1 1
      Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs
  22. 1 1
      Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
  23. 1 1
      Emby.Server.Implementations/Localization/LocalizationManager.cs
  24. 1 1
      Emby.Server.Implementations/MediaEncoder/EncodingManager.cs
  25. 1 1
      Emby.Server.Implementations/Playlists/PlaylistManager.cs
  26. 1 1
      Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
  27. 2 2
      Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
  28. 1 1
      Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
  29. 1 1
      Emby.Server.Implementations/Updates/InstallationManager.cs
  30. 3 3
      Jellyfin.Drawing.Skia/SkiaEncoder.cs
  31. 2 2
      MediaBrowser.Api/Images/RemoteImageService.cs
  32. 2 2
      MediaBrowser.Api/ItemLookupService.cs
  33. 2 2
      MediaBrowser.Api/Playback/BaseStreamingService.cs
  34. 3 2
      MediaBrowser.Controller/Entities/User.cs
  35. 1 1
      MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs
  36. 2 2
      MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
  37. 2 2
      MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
  38. 2 2
      MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
  39. 1 1
      MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs
  40. 1 1
      MediaBrowser.Providers/Manager/ImageSaver.cs
  41. 1 1
      MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs
  42. 1 1
      MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs
  43. 1 1
      MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs
  44. 1 1
      MediaBrowser.Providers/Movies/MovieDbProvider.cs
  45. 1 1
      MediaBrowser.Providers/Music/AudioDbAlbumProvider.cs
  46. 1 1
      MediaBrowser.Providers/Music/AudioDbArtistProvider.cs
  47. 1 1
      MediaBrowser.Providers/Music/FanArtArtistProvider.cs
  48. 2 2
      MediaBrowser.Providers/Omdb/OmdbProvider.cs
  49. 1 1
      MediaBrowser.Providers/People/MovieDbPersonProvider.cs
  50. 1 1
      MediaBrowser.Providers/Studios/StudiosImageProvider.cs
  51. 1 1
      MediaBrowser.Providers/Subtitles/SubtitleManager.cs
  52. 1 1
      MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs
  53. 1 1
      MediaBrowser.Providers/TV/TheMovieDb/MovieDbProviderBase.cs
  54. 1 1
      MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeasonProvider.cs
  55. 2 2
      MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeriesProvider.cs
  56. 2 2
      MediaBrowser.Providers/TV/TheTVDB/TvdbPrescanTask.cs
  57. 3 3
      MediaBrowser.WebDashboard/Api/DashboardService.cs
  58. 1 1
      MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs

+ 2 - 2
Emby.Dlna/DlnaManager.cs

@@ -379,7 +379,7 @@ namespace Emby.Dlna
 
 
                     if (!fileInfo.Exists || fileInfo.Length != stream.Length)
                     if (!fileInfo.Exists || fileInfo.Length != stream.Length)
                     {
                     {
-                        _fileSystem.CreateDirectory(systemProfilesPath);
+                        Directory.CreateDirectory(systemProfilesPath);
 
 
                         using (var fileStream = _fileSystem.GetFileStream(path, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
                         using (var fileStream = _fileSystem.GetFileStream(path, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
                         {
                         {
@@ -390,7 +390,7 @@ namespace Emby.Dlna
             }
             }
 
 
             // Not necessary, but just to make it easy to find
             // Not necessary, but just to make it easy to find
-            _fileSystem.CreateDirectory(UserProfilesPath);
+            Directory.CreateDirectory(UserProfilesPath);
         }
         }
 
 
         public void DeleteProfile(string id)
         public void DeleteProfile(string id)

+ 1 - 1
Emby.Drawing/ImageProcessor.cs

@@ -631,7 +631,7 @@ namespace Emby.Drawing
                     return (enhancedImagePath, treatmentRequiresTransparency);
                     return (enhancedImagePath, treatmentRequiresTransparency);
                 }
                 }
 
 
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(enhancedImagePath));
+                Directory.CreateDirectory(Path.GetDirectoryName(enhancedImagePath));
 
 
                 await ExecuteImageEnhancers(supportedEnhancers, originalImagePath, enhancedImagePath, item, imageType, imageIndex).ConfigureAwait(false);
                 await ExecuteImageEnhancers(supportedEnhancers, originalImagePath, enhancedImagePath, item, imageType, imageIndex).ConfigureAwait(false);
 
 

+ 3 - 3
Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs

@@ -327,7 +327,7 @@ namespace IsoMounter
 
 
             try
             try
             {
             {
-                FileSystem.CreateDirectory(mountPoint);
+                Directory.CreateDirectory(mountPoint);
             }
             }
             catch (UnauthorizedAccessException)
             catch (UnauthorizedAccessException)
             {
             {
@@ -377,7 +377,7 @@ namespace IsoMounter
 
 
                 try
                 try
                 {
                 {
-                    FileSystem.DeleteDirectory(mountPoint, false);
+                    Directory.Delete(mountPoint, false);
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
@@ -455,7 +455,7 @@ namespace IsoMounter
 
 
             try
             try
             {
             {
-                FileSystem.DeleteDirectory(mount.MountedPath, false);
+                Directory.Delete(mount.MountedPath, false);
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {

+ 2 - 2
Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs

@@ -127,7 +127,7 @@ namespace Emby.Server.Implementations.AppBase
             Logger.LogInformation("Saving system configuration");
             Logger.LogInformation("Saving system configuration");
             var path = CommonApplicationPaths.SystemConfigurationFilePath;
             var path = CommonApplicationPaths.SystemConfigurationFilePath;
 
 
-            FileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             lock (_configurationSyncLock)
             lock (_configurationSyncLock)
             {
             {
@@ -294,7 +294,7 @@ namespace Emby.Server.Implementations.AppBase
             _configurations.AddOrUpdate(key, configuration, (k, v) => configuration);
             _configurations.AddOrUpdate(key, configuration, (k, v) => configuration);
 
 
             var path = GetConfigurationFile(key);
             var path = GetConfigurationFile(key);
-            FileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             lock (_configurationSyncLock)
             lock (_configurationSyncLock)
             {
             {

+ 1 - 1
Emby.Server.Implementations/AppBase/ConfigurationHelper.cs

@@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.AppBase
                 // If the file didn't exist before, or if something has changed, re-save
                 // If the file didn't exist before, or if something has changed, re-save
                 if (buffer == null || !buffer.SequenceEqual(newBytes))
                 if (buffer == null || !buffer.SequenceEqual(newBytes))
                 {
                 {
-                    fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                    Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                     // Save it after load in case we got new items
                     // Save it after load in case we got new items
                     fileSystem.WriteAllBytes(path, newBytes);
                     fileSystem.WriteAllBytes(path, newBytes);

+ 2 - 2
Emby.Server.Implementations/Channels/ChannelManager.cs

@@ -355,7 +355,7 @@ namespace Emby.Server.Implementations.Channels
                 return;
                 return;
             }
             }
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             _jsonSerializer.SerializeToFile(mediaSources, path);
             _jsonSerializer.SerializeToFile(mediaSources, path);
         }
         }
@@ -834,7 +834,7 @@ namespace Emby.Server.Implementations.Channels
         {
         {
             try
             try
             {
             {
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                 _jsonSerializer.SerializeToFile(result, path);
                 _jsonSerializer.SerializeToFile(result, path);
             }
             }

+ 2 - 2
Emby.Server.Implementations/Collections/CollectionManager.cs

@@ -76,7 +76,7 @@ namespace Emby.Server.Implementations.Collections
                 return null;
                 return null;
             }
             }
 
 
-            _fileSystem.CreateDirectory(path);
+            Directory.CreateDirectory(path);
 
 
             var libraryOptions = new LibraryOptions
             var libraryOptions = new LibraryOptions
             {
             {
@@ -133,7 +133,7 @@ namespace Emby.Server.Implementations.Collections
 
 
             try
             try
             {
             {
-                _fileSystem.CreateDirectory(path);
+                Directory.CreateDirectory(path);
 
 
                 var collection = new BoxSet
                 var collection = new BoxSet
                 {
                 {

+ 1 - 1
Emby.Server.Implementations/Devices/DeviceId.cs

@@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Devices
             {
             {
                 var path = CachePath;
                 var path = CachePath;
 
 
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                 lock (_syncLock)
                 lock (_syncLock)
                 {
                 {

+ 4 - 4
Emby.Server.Implementations/Devices/DeviceManager.cs

@@ -76,7 +76,7 @@ namespace Emby.Server.Implementations.Devices
         public void SaveCapabilities(string deviceId, ClientCapabilities capabilities)
         public void SaveCapabilities(string deviceId, ClientCapabilities capabilities)
         {
         {
             var path = Path.Combine(GetDevicePath(deviceId), "capabilities.json");
             var path = Path.Combine(GetDevicePath(deviceId), "capabilities.json");
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             lock (_capabilitiesSyncLock)
             lock (_capabilitiesSyncLock)
             {
             {
@@ -239,7 +239,7 @@ namespace Emby.Server.Implementations.Devices
             path = Path.Combine(path, file.Name);
             path = Path.Combine(path, file.Name);
             path = Path.ChangeExtension(path, MimeTypes.ToExtension(file.MimeType) ?? "jpg");
             path = Path.ChangeExtension(path, MimeTypes.ToExtension(file.MimeType) ?? "jpg");
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             await EnsureLibraryFolder(uploadPathInfo.Item2, uploadPathInfo.Item3).ConfigureAwait(false);
             await EnsureLibraryFolder(uploadPathInfo.Item2, uploadPathInfo.Item3).ConfigureAwait(false);
 
 
@@ -275,7 +275,7 @@ namespace Emby.Server.Implementations.Devices
         private void AddCameraUpload(string deviceId, LocalFileInfo file)
         private void AddCameraUpload(string deviceId, LocalFileInfo file)
         {
         {
             var path = Path.Combine(GetDevicePath(deviceId), "camerauploads.json");
             var path = Path.Combine(GetDevicePath(deviceId), "camerauploads.json");
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             lock (_cameraUploadSyncLock)
             lock (_cameraUploadSyncLock)
             {
             {
@@ -317,7 +317,7 @@ namespace Emby.Server.Implementations.Devices
                 return Task.CompletedTask;
                 return Task.CompletedTask;
             }
             }
 
 
-            _fileSystem.CreateDirectory(path);
+            Directory.CreateDirectory(path);
 
 
             var libraryOptions = new LibraryOptions
             var libraryOptions = new LibraryOptions
             {
             {

+ 1 - 1
Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs

@@ -75,7 +75,7 @@ namespace Emby.Server.Implementations.FFMpeg
                 Version = version
                 Version = version
             };
             };
 
 
-            _fileSystem.CreateDirectory(versionedDirectoryPath);
+            Directory.CreateDirectory(versionedDirectoryPath);
 
 
             var excludeFromDeletions = new List<string> { versionedDirectoryPath };
             var excludeFromDeletions = new List<string> { versionedDirectoryPath };
 
 

+ 2 - 2
Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs

@@ -305,7 +305,7 @@ namespace Emby.Server.Implementations.HttpClientManager
 
 
         private async Task CacheResponse(HttpResponseInfo response, string responseCachePath)
         private async Task CacheResponse(HttpResponseInfo response, string responseCachePath)
         {
         {
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(responseCachePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(responseCachePath));
 
 
             using (var fileStream = _fileSystem.GetFileStream(responseCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.None, true))
             using (var fileStream = _fileSystem.GetFileStream(responseCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.None, true))
             {
             {
@@ -513,7 +513,7 @@ namespace Emby.Server.Implementations.HttpClientManager
         {
         {
             ValidateParams(options);
             ValidateParams(options);
 
 
-            _fileSystem.CreateDirectory(_appPaths.TempDirectory);
+            Directory.CreateDirectory(_appPaths.TempDirectory);
 
 
             var tempFile = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + ".tmp");
             var tempFile = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + ".tmp");
 
 

+ 2 - 2
Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs

@@ -99,7 +99,7 @@ namespace Emby.Server.Implementations.Images
             CancellationToken cancellationToken)
             CancellationToken cancellationToken)
         {
         {
             var outputPathWithoutExtension = Path.Combine(ApplicationPaths.TempDirectory, Guid.NewGuid().ToString("N"));
             var outputPathWithoutExtension = Path.Combine(ApplicationPaths.TempDirectory, Guid.NewGuid().ToString("N"));
-            FileSystem.CreateDirectory(Path.GetDirectoryName(outputPathWithoutExtension));
+            Directory.CreateDirectory(Path.GetDirectoryName(outputPathWithoutExtension));
             string outputPath = CreateImage(item, itemsWithImages, outputPathWithoutExtension, imageType, 0);
             string outputPath = CreateImage(item, itemsWithImages, outputPathWithoutExtension, imageType, 0);
 
 
             if (string.IsNullOrEmpty(outputPath))
             if (string.IsNullOrEmpty(outputPath))
@@ -165,7 +165,7 @@ namespace Emby.Server.Implementations.Images
 
 
         private string CreateCollage(BaseItem primaryItem, List<BaseItem> items, string outputPath, int width, int height)
         private string CreateCollage(BaseItem primaryItem, List<BaseItem> items, string outputPath, int width, int height)
         {
         {
-            FileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
 
 
             var options = new ImageCollageOptions
             var options = new ImageCollageOptions
             {
             {

+ 13 - 13
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -375,7 +375,7 @@ namespace Emby.Server.Implementations.Library
 
 
                 try
                 try
                 {
                 {
-                    _fileSystem.DeleteDirectory(metadataPath, true);
+                    Directory.Delete(metadataPath, true);
                 }
                 }
                 catch (IOException)
                 catch (IOException)
                 {
                 {
@@ -402,11 +402,11 @@ namespace Emby.Server.Implementations.Library
                             _logger.LogDebug("Deleting path {path}", fileSystemInfo.FullName);
                             _logger.LogDebug("Deleting path {path}", fileSystemInfo.FullName);
                             if (fileSystemInfo.IsDirectory)
                             if (fileSystemInfo.IsDirectory)
                             {
                             {
-                                _fileSystem.DeleteDirectory(fileSystemInfo.FullName, true);
+                                Directory.Delete(fileSystemInfo.FullName, true);
                             }
                             }
                             else
                             else
                             {
                             {
-                                _fileSystem.DeleteFile(fileSystemInfo.FullName);
+                                File.Delete(fileSystemInfo.FullName);
                             }
                             }
                         }
                         }
                         catch (IOException)
                         catch (IOException)
@@ -720,7 +720,7 @@ namespace Emby.Server.Implementations.Library
         {
         {
             var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;
             var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;
 
 
-            _fileSystem.CreateDirectory(rootFolderPath);
+            Directory.CreateDirectory(rootFolderPath);
 
 
             var rootFolder = GetItemById(GetNewItemId(rootFolderPath, typeof(AggregateFolder))) as AggregateFolder ?? ((Folder)ResolvePath(_fileSystem.GetDirectoryInfo(rootFolderPath))).DeepCopy<Folder, AggregateFolder>();
             var rootFolder = GetItemById(GetNewItemId(rootFolderPath, typeof(AggregateFolder))) as AggregateFolder ?? ((Folder)ResolvePath(_fileSystem.GetDirectoryInfo(rootFolderPath))).DeepCopy<Folder, AggregateFolder>();
 
 
@@ -734,7 +734,7 @@ namespace Emby.Server.Implementations.Library
             // Add in the plug-in folders
             // Add in the plug-in folders
             var path = Path.Combine(ConfigurationManager.ApplicationPaths.DataPath, "playlists");
             var path = Path.Combine(ConfigurationManager.ApplicationPaths.DataPath, "playlists");
 
 
-            _fileSystem.CreateDirectory(path);
+            Directory.CreateDirectory(path);
 
 
             Folder folder = new PlaylistsFolder
             Folder folder = new PlaylistsFolder
             {
             {
@@ -785,7 +785,7 @@ namespace Emby.Server.Implementations.Library
                     {
                     {
                         var userRootPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
                         var userRootPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
 
 
-                        _fileSystem.CreateDirectory(userRootPath);
+                        Directory.CreateDirectory(userRootPath);
 
 
                         var tmpItem = GetItemById(GetNewItemId(userRootPath, typeof(UserRootFolder))) as UserRootFolder;
                         var tmpItem = GetItemById(GetNewItemId(userRootPath, typeof(UserRootFolder))) as UserRootFolder;
 
 
@@ -999,7 +999,7 @@ namespace Emby.Server.Implementations.Library
         public Task ValidatePeople(CancellationToken cancellationToken, IProgress<double> progress)
         public Task ValidatePeople(CancellationToken cancellationToken, IProgress<double> progress)
         {
         {
             // Ensure the location is available.
             // Ensure the location is available.
-            _fileSystem.CreateDirectory(ConfigurationManager.ApplicationPaths.PeoplePath);
+            Directory.CreateDirectory(ConfigurationManager.ApplicationPaths.PeoplePath);
 
 
             return new PeopleValidator(this, _logger, ConfigurationManager, _fileSystem).ValidatePeople(cancellationToken, progress);
             return new PeopleValidator(this, _logger, ConfigurationManager, _fileSystem).ValidatePeople(cancellationToken, progress);
         }
         }
@@ -2146,7 +2146,7 @@ namespace Emby.Server.Implementations.Library
 
 
             if (item == null || !string.Equals(item.Path, path, StringComparison.OrdinalIgnoreCase))
             if (item == null || !string.Equals(item.Path, path, StringComparison.OrdinalIgnoreCase))
             {
             {
-                _fileSystem.CreateDirectory(path);
+                Directory.CreateDirectory(path);
 
 
                 item = new UserView
                 item = new UserView
                 {
                 {
@@ -2191,7 +2191,7 @@ namespace Emby.Server.Implementations.Library
 
 
             if (item == null)
             if (item == null)
             {
             {
-                _fileSystem.CreateDirectory(path);
+                Directory.CreateDirectory(path);
 
 
                 item = new UserView
                 item = new UserView
                 {
                 {
@@ -2256,7 +2256,7 @@ namespace Emby.Server.Implementations.Library
 
 
             if (item == null)
             if (item == null)
             {
             {
-                _fileSystem.CreateDirectory(path);
+                Directory.CreateDirectory(path);
 
 
                 item = new UserView
                 item = new UserView
                 {
                 {
@@ -2324,7 +2324,7 @@ namespace Emby.Server.Implementations.Library
 
 
             if (item == null)
             if (item == null)
             {
             {
-                _fileSystem.CreateDirectory(path);
+                Directory.CreateDirectory(path);
 
 
                 item = new UserView
                 item = new UserView
                 {
                 {
@@ -2883,7 +2883,7 @@ namespace Emby.Server.Implementations.Library
 
 
             try
             try
             {
             {
-                _fileSystem.CreateDirectory(virtualFolderPath);
+                Directory.CreateDirectory(virtualFolderPath);
 
 
                 if (!string.IsNullOrEmpty(collectionType))
                 if (!string.IsNullOrEmpty(collectionType))
                 {
                 {
@@ -3082,7 +3082,7 @@ namespace Emby.Server.Implementations.Library
 
 
             try
             try
             {
             {
-                _fileSystem.DeleteDirectory(path, true);
+                Directory.Delete(path, true);
             }
             }
             finally
             finally
             {
             {

+ 1 - 1
Emby.Server.Implementations/Library/MediaSourceManager.cs

@@ -670,7 +670,7 @@ namespace Emby.Server.Implementations.Library
 
 
                 if (cacheFilePath != null)
                 if (cacheFilePath != null)
                 {
                 {
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
+                    Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
                     _jsonSerializer.SerializeToFile(mediaInfo, cacheFilePath);
                     _jsonSerializer.SerializeToFile(mediaInfo, cacheFilePath);
 
 
                     //_logger.LogDebug("Saved media info to {0}", cacheFilePath);
                     //_logger.LogDebug("Saved media info to {0}", cacheFilePath);

+ 2 - 2
Emby.Server.Implementations/Library/UserManager.cs

@@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations.Library
 
 
             var path = GetPolicyFilePath(user);
             var path = GetPolicyFilePath(user);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             lock (_policySyncLock)
             lock (_policySyncLock)
             {
             {
@@ -1176,7 +1176,7 @@ namespace Emby.Server.Implementations.Library
                 config = _jsonSerializer.DeserializeFromString<UserConfiguration>(json);
                 config = _jsonSerializer.DeserializeFromString<UserConfiguration>(json);
             }
             }
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             lock (_configSyncLock)
             lock (_configSyncLock)
             {
             {

+ 2 - 2
Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs

@@ -42,7 +42,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
 
 
         private async Task RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
         private async Task RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
         {
         {
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(targetFile));
+            Directory.CreateDirectory(Path.GetDirectoryName(targetFile));
 
 
             using (var output = _fileSystem.GetFileStream(targetFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
             using (var output = _fileSystem.GetFileStream(targetFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
             {
             {
@@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
             {
             {
                 _logger.LogInformation("Opened recording stream from tuner provider");
                 _logger.LogInformation("Opened recording stream from tuner provider");
 
 
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(targetFile));
+                Directory.CreateDirectory(Path.GetDirectoryName(targetFile));
 
 
                 using (var output = _fileSystem.GetFileStream(targetFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
                 using (var output = _fileSystem.GetFileStream(targetFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
                 {
                 {

+ 2 - 2
Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs

@@ -79,7 +79,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
         private Task RecordFromFile(MediaSourceInfo mediaSource, string inputFile, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
         private Task RecordFromFile(MediaSourceInfo mediaSource, string inputFile, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
         {
         {
             _targetPath = targetFile;
             _targetPath = targetFile;
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(targetFile));
+            Directory.CreateDirectory(Path.GetDirectoryName(targetFile));
 
 
             var process = _processFactory.Create(new ProcessOptions
             var process = _processFactory.Create(new ProcessOptions
             {
             {
@@ -105,7 +105,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
             _logger.LogInformation(commandLineLogMessage);
             _logger.LogInformation(commandLineLogMessage);
 
 
             var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "record-transcode-" + Guid.NewGuid() + ".txt");
             var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "record-transcode-" + Guid.NewGuid() + ".txt");
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(logFilePath));
 
 
             // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
             // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
             _logFileStream = _fileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);
             _logFileStream = _fileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);

+ 1 - 1
Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs

@@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
             }
             }
 
 
             var file = _dataPath + ".json";
             var file = _dataPath + ".json";
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(file));
+            Directory.CreateDirectory(Path.GetDirectoryName(file));
 
 
             lock (_fileDataLock)
             lock (_fileDataLock)
             {
             {

+ 3 - 3
Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs

@@ -83,7 +83,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings
 
 
             }).ConfigureAwait(false);
             }).ConfigureAwait(false);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(cacheFile));
+            Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
 
 
             _fileSystem.CopyFile(tempFile, cacheFile, true);
             _fileSystem.CopyFile(tempFile, cacheFile, true);
 
 
@@ -125,7 +125,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings
             using (var stream = _fileSystem.OpenRead(file))
             using (var stream = _fileSystem.OpenRead(file))
             {
             {
                 string tempFolder = Path.Combine(_config.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString());
                 string tempFolder = Path.Combine(_config.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString());
-                _fileSystem.CreateDirectory(tempFolder);
+                Directory.CreateDirectory(tempFolder);
 
 
                 _zipClient.ExtractFirstFileFromGz(stream, tempFolder, "data.xml");
                 _zipClient.ExtractFirstFileFromGz(stream, tempFolder, "data.xml");
 
 
@@ -138,7 +138,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings
             using (var stream = _fileSystem.OpenRead(file))
             using (var stream = _fileSystem.OpenRead(file))
             {
             {
                 string tempFolder = Path.Combine(_config.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString());
                 string tempFolder = Path.Combine(_config.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString());
-                _fileSystem.CreateDirectory(tempFolder);
+                Directory.CreateDirectory(tempFolder);
 
 
                 _zipClient.ExtractAllFromGz(stream, tempFolder, true);
                 _zipClient.ExtractAllFromGz(stream, tempFolder, true);
 
 

+ 1 - 1
Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs

@@ -95,7 +95,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
                     {
                     {
                         try
                         try
                         {
                         {
-                            FileSystem.CreateDirectory(Path.GetDirectoryName(channelCacheFile));
+                            Directory.CreateDirectory(Path.GetDirectoryName(channelCacheFile));
                             JsonSerializer.SerializeToFile(channels, channelCacheFile);
                             JsonSerializer.SerializeToFile(channels, channelCacheFile);
                         }
                         }
                         catch (IOException)
                         catch (IOException)

+ 1 - 1
Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs

@@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
             var uri = new Uri(mediaSource.Path);
             var uri = new Uri(mediaSource.Path);
             var localPort = _networkManager.GetRandomUnusedUdpPort();
             var localPort = _networkManager.GetRandomUnusedUdpPort();
 
 
-            FileSystem.CreateDirectory(Path.GetDirectoryName(TempFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(TempFilePath));
 
 
             Logger.LogInformation("Opening HDHR UDP Live stream from {host}", uri.Host);
             Logger.LogInformation("Opening HDHR UDP Live stream from {host}", uri.Host);
 
 

+ 1 - 1
Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs

@@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
 
 
             var url = mediaSource.Path;
             var url = mediaSource.Path;
 
 
-            FileSystem.CreateDirectory(Path.GetDirectoryName(TempFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(TempFilePath));
 
 
             var typeName = GetType().Name;
             var typeName = GetType().Name;
             Logger.LogInformation("Opening " + typeName + " Live stream from {0}", url);
             Logger.LogInformation("Opening " + typeName + " Live stream from {0}", url);

+ 1 - 1
Emby.Server.Implementations/Localization/LocalizationManager.cs

@@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.Localization
 
 
             var localizationPath = LocalizationPath;
             var localizationPath = LocalizationPath;
 
 
-            _fileSystem.CreateDirectory(localizationPath);
+            Directory.CreateDirectory(localizationPath);
 
 
             var existingFiles = GetRatingsFiles(localizationPath)
             var existingFiles = GetRatingsFiles(localizationPath)
                 .Select(Path.GetFileName)
                 .Select(Path.GetFileName)

+ 1 - 1
Emby.Server.Implementations/MediaEncoder/EncodingManager.cs

@@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.MediaEncoder
 
 
                             var inputPath = MediaEncoderHelpers.GetInputArgument(_fileSystem, video.Path, protocol, null, Array.Empty<string>());
                             var inputPath = MediaEncoderHelpers.GetInputArgument(_fileSystem, video.Path, protocol, null, Array.Empty<string>());
 
 
-                            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                             var container = video.Container;
                             var container = video.Container;
 
 

+ 1 - 1
Emby.Server.Implementations/Playlists/PlaylistManager.cs

@@ -119,7 +119,7 @@ namespace Emby.Server.Implementations.Playlists
 
 
             try
             try
             {
             {
-                _fileSystem.CreateDirectory(path);
+                Directory.CreateDirectory(path);
 
 
                 var playlist = new Playlist
                 var playlist = new Playlist
                 {
                 {

+ 1 - 1
Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs

@@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
 
 
                         var parentPath = Path.GetDirectoryName(failHistoryPath);
                         var parentPath = Path.GetDirectoryName(failHistoryPath);
 
 
-                        _fileSystem.CreateDirectory(parentPath);
+                        Directory.CreateDirectory(parentPath);
 
 
                         _fileSystem.WriteAllText(failHistoryPath, string.Join("|", previouslyFailedImages.ToArray()));
                         _fileSystem.WriteAllText(failHistoryPath, string.Join("|", previouslyFailedImages.ToArray()));
                     }
                     }

+ 2 - 2
Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs

@@ -151,7 +151,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
                 _lastExecutionResult = value;
                 _lastExecutionResult = value;
 
 
                 var path = GetHistoryFilePath();
                 var path = GetHistoryFilePath();
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                 lock (_lastExecutionResultSyncLock)
                 lock (_lastExecutionResultSyncLock)
                 {
                 {
@@ -565,7 +565,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
         {
         {
             var path = GetConfigurationFilePath();
             var path = GetConfigurationFilePath();
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             JsonSerializer.SerializeToFile(triggers, path);
             JsonSerializer.SerializeToFile(triggers, path);
         }
         }

+ 1 - 1
Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs

@@ -128,7 +128,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
                 {
                 {
                     try
                     try
                     {
                     {
-                        _fileSystem.DeleteDirectory(directory, false);
+                        Directory.Delete(directory, false);
                     }
                     }
                     catch (UnauthorizedAccessException ex)
                     catch (UnauthorizedAccessException ex)
                     {
                     {

+ 1 - 1
Emby.Server.Implementations/Updates/InstallationManager.cs

@@ -570,7 +570,7 @@ namespace Emby.Server.Implementations.Updates
             // Success - move it to the real target
             // Success - move it to the real target
             try
             try
             {
             {
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(target));
+                Directory.CreateDirectory(Path.GetDirectoryName(target));
                 _fileSystem.CopyFile(tempFile, target, true);
                 _fileSystem.CopyFile(tempFile, target, true);
                 //If it is an archive - write out a version file so we know what it is
                 //If it is an archive - write out a version file so we know what it is
                 if (isArchive)
                 if (isArchive)

+ 3 - 3
Jellyfin.Drawing.Skia/SkiaEncoder.cs

@@ -219,7 +219,7 @@ namespace Jellyfin.Drawing.Skia
 
 
             var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path) ?? string.Empty);
             var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path) ?? string.Empty);
 
 
-            fileSystem.CreateDirectory(Path.GetDirectoryName(tempPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(tempPath));
             fileSystem.CopyFile(path, tempPath, true);
             fileSystem.CopyFile(path, tempPath, true);
 
 
             return tempPath;
             return tempPath;
@@ -532,7 +532,7 @@ namespace Jellyfin.Drawing.Skia
                     // If all we're doing is resizing then we can stop now
                     // If all we're doing is resizing then we can stop now
                     if (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)
                     if (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)
                     {
                     {
-                        _fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
+                        Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
                         using (var outputStream = new SKFileWStream(outputPath))
                         using (var outputStream = new SKFileWStream(outputPath))
                         using (var pixmap = new SKPixmap(new SKImageInfo(width, height), resizedBitmap.GetPixels()))
                         using (var pixmap = new SKPixmap(new SKImageInfo(width, height), resizedBitmap.GetPixels()))
                         {
                         {
@@ -584,7 +584,7 @@ namespace Jellyfin.Drawing.Skia
                             DrawIndicator(canvas, width, height, options);
                             DrawIndicator(canvas, width, height, options);
                         }
                         }
 
 
-                        _fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
+                        Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
                         using (var outputStream = new SKFileWStream(outputPath))
                         using (var outputStream = new SKFileWStream(outputPath))
                         {
                         {
                             using (var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels()))
                             using (var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels()))

+ 2 - 2
MediaBrowser.Api/Images/RemoteImageService.cs

@@ -264,7 +264,7 @@ namespace MediaBrowser.Api.Images
 
 
                 var fullCachePath = GetFullCachePath(urlHash + "." + ext);
                 var fullCachePath = GetFullCachePath(urlHash + "." + ext);
 
 
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(fullCachePath));
+                Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
                 using (var stream = result.Content)
                 using (var stream = result.Content)
                 {
                 {
                     using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
@@ -273,7 +273,7 @@ namespace MediaBrowser.Api.Images
                     }
                     }
                 }
                 }
 
 
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
+                Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
                 _fileSystem.WriteAllText(pointerCachePath, fullCachePath);
                 _fileSystem.WriteAllText(pointerCachePath, fullCachePath);
             }
             }
         }
         }

+ 2 - 2
MediaBrowser.Api/ItemLookupService.cs

@@ -305,7 +305,7 @@ namespace MediaBrowser.Api
 
 
             var fullCachePath = GetFullCachePath(urlHash + "." + ext);
             var fullCachePath = GetFullCachePath(urlHash + "." + ext);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(fullCachePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
             using (var stream = result.Content)
             using (var stream = result.Content)
             {
             {
                 using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                 using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
@@ -314,7 +314,7 @@ namespace MediaBrowser.Api
                 }
                 }
             }
             }
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
             _fileSystem.WriteAllText(pointerCachePath, fullCachePath);
             _fileSystem.WriteAllText(pointerCachePath, fullCachePath);
         }
         }
 
 

+ 2 - 2
MediaBrowser.Api/Playback/BaseStreamingService.cs

@@ -192,7 +192,7 @@ namespace MediaBrowser.Api.Playback
             CancellationTokenSource cancellationTokenSource,
             CancellationTokenSource cancellationTokenSource,
             string workingDirectory = null)
             string workingDirectory = null)
         {
         {
-            FileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
 
 
             await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);
             await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);
 
 
@@ -258,7 +258,7 @@ namespace MediaBrowser.Api.Playback
             }
             }
 
 
             var logFilePath = Path.Combine(ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, logFilePrefix + "-" + Guid.NewGuid() + ".txt");
             var logFilePath = Path.Combine(ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, logFilePrefix + "-" + Guid.NewGuid() + ".txt");
-            FileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(logFilePath));
 
 
             // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
             // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
             state.LogFileStream = FileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);
             state.LogFileStream = FileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);

+ 3 - 2
MediaBrowser.Controller/Entities/User.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.IO;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
@@ -169,7 +170,7 @@ namespace MediaBrowser.Controller.Entities
                 // Exceptions will be thrown if these paths already exist
                 // Exceptions will be thrown if these paths already exist
                 if (FileSystem.DirectoryExists(newConfigDirectory))
                 if (FileSystem.DirectoryExists(newConfigDirectory))
                 {
                 {
-                    FileSystem.DeleteDirectory(newConfigDirectory, true);
+                    Directory.Delete(newConfigDirectory, true);
                 }
                 }
 
 
                 if (FileSystem.DirectoryExists(oldConfigurationDirectory))
                 if (FileSystem.DirectoryExists(oldConfigurationDirectory))
@@ -178,7 +179,7 @@ namespace MediaBrowser.Controller.Entities
                 }
                 }
                 else
                 else
                 {
                 {
-                    FileSystem.CreateDirectory(newConfigDirectory);
+                    Directory.CreateDirectory(newConfigDirectory);
                 }
                 }
             }
             }
 
 

+ 1 - 1
MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs

@@ -94,7 +94,7 @@ namespace MediaBrowser.LocalMetadata.Savers
 
 
         private void SaveToFile(Stream stream, string path)
         private void SaveToFile(Stream stream, string path)
         {
         {
-            FileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
             // On Windows, savint the file will fail if the file is hidden or readonly
             // On Windows, savint the file will fail if the file is hidden or readonly
             FileSystem.SetAttributes(path, false, false);
             FileSystem.SetAttributes(path, false, false);
 
 

+ 2 - 2
MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs

@@ -67,7 +67,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 .CreateJob(options, EncodingHelper, IsVideoEncoder, progress, cancellationToken).ConfigureAwait(false);
                 .CreateJob(options, EncodingHelper, IsVideoEncoder, progress, cancellationToken).ConfigureAwait(false);
 
 
             encodingJob.OutputFilePath = GetOutputFilePath(encodingJob);
             encodingJob.OutputFilePath = GetOutputFilePath(encodingJob);
-            FileSystem.CreateDirectory(Path.GetDirectoryName(encodingJob.OutputFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(encodingJob.OutputFilePath));
 
 
             encodingJob.ReadInputAtNativeFramerate = options.ReadInputAtNativeFramerate;
             encodingJob.ReadInputAtNativeFramerate = options.ReadInputAtNativeFramerate;
 
 
@@ -105,7 +105,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
             Logger.LogInformation(commandLineLogMessage);
             Logger.LogInformation(commandLineLogMessage);
 
 
             var logFilePath = Path.Combine(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, "transcode-" + Guid.NewGuid() + ".txt");
             var logFilePath = Path.Combine(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, "transcode-" + Guid.NewGuid() + ".txt");
-            FileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(logFilePath));
 
 
             // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
             // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
             encodingJob.LogFileStream = FileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);
             encodingJob.LogFileStream = FileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);

+ 2 - 2
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -608,7 +608,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
             }
             }
 
 
             var tempExtractPath = Path.Combine(ConfigurationManager.ApplicationPaths.TempDirectory, Guid.NewGuid() + ".jpg");
             var tempExtractPath = Path.Combine(ConfigurationManager.ApplicationPaths.TempDirectory, Guid.NewGuid() + ".jpg");
-            FileSystem.CreateDirectory(Path.GetDirectoryName(tempExtractPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(tempExtractPath));
 
 
             // apply some filters to thumbnail extracted below (below) crop any black lines that we made and get the correct ar then scale to width 600.
             // apply some filters to thumbnail extracted below (below) crop any black lines that we made and get the correct ar then scale to width 600.
             // This filter chain may have adverse effects on recorded tv thumbnails if ar changes during presentation ex. commercials @ diff ar
             // This filter chain may have adverse effects on recorded tv thumbnails if ar changes during presentation ex. commercials @ diff ar
@@ -770,7 +770,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 vf += string.Format(",scale=min(iw\\,{0}):trunc(ow/dar/2)*2", maxWidthParam);
                 vf += string.Format(",scale=min(iw\\,{0}):trunc(ow/dar/2)*2", maxWidthParam);
             }
             }
 
 
-            FileSystem.CreateDirectory(targetDirectory);
+            Directory.CreateDirectory(targetDirectory);
             var outputPath = Path.Combine(targetDirectory, filenamePrefix + "%05d.jpg");
             var outputPath = Path.Combine(targetDirectory, filenamePrefix + "%05d.jpg");
 
 
             var args = string.Format("-i {0} -threads 0 -v quiet -vf \"{2}\" -f image2 \"{1}\"", inputArgument, outputPath, vf);
             var args = string.Format("-i {0} -threads 0 -v quiet -vf \"{2}\" -f image2 \"{1}\"", inputArgument, outputPath, vf);

+ 2 - 2
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs

@@ -422,7 +422,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
                 throw new ArgumentNullException(nameof(outputPath));
                 throw new ArgumentNullException(nameof(outputPath));
             }
             }
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
 
 
             var encodingParam = await GetSubtitleFileCharacterSet(inputPath, language, inputProtocol, cancellationToken).ConfigureAwait(false);
             var encodingParam = await GetSubtitleFileCharacterSet(inputPath, language, inputProtocol, cancellationToken).ConfigureAwait(false);
 
 
@@ -565,7 +565,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
                 throw new ArgumentNullException(nameof(outputPath));
                 throw new ArgumentNullException(nameof(outputPath));
             }
             }
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
 
 
             var processArgs = string.Format("-i {0} -map 0:{1} -an -vn -c:s {2} \"{3}\"", inputPath,
             var processArgs = string.Format("-i {0} -map 0:{1} -an -vn -c:s {2} \"{3}\"", inputPath,
                 subtitleStreamIndex, outputCodec, outputPath);
                 subtitleStreamIndex, outputCodec, outputPath);

+ 1 - 1
MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs

@@ -156,7 +156,7 @@ namespace MediaBrowser.Providers.BoxSets
 
 
             var dataFilePath = GetDataFilePath(_config.ApplicationPaths, tmdbId, preferredMetadataLanguage);
             var dataFilePath = GetDataFilePath(_config.ApplicationPaths, tmdbId, preferredMetadataLanguage);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
 
 
             _json.SerializeToFile(mainResult, dataFilePath);
             _json.SerializeToFile(mainResult, dataFilePath);
         }
         }

+ 1 - 1
MediaBrowser.Providers/Manager/ImageSaver.cs

@@ -240,7 +240,7 @@ namespace MediaBrowser.Providers.Manager
                 _libraryMonitor.ReportFileSystemChangeBeginning(path);
                 _libraryMonitor.ReportFileSystemChangeBeginning(path);
                 _libraryMonitor.ReportFileSystemChangeBeginning(parentFolder);
                 _libraryMonitor.ReportFileSystemChangeBeginning(parentFolder);
 
 
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                 _fileSystem.SetAttributes(path, false, false);
                 _fileSystem.SetAttributes(path, false, false);
 
 

+ 1 - 1
MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs

@@ -60,7 +60,7 @@ namespace MediaBrowser.Providers.MediaInfo
 
 
             if (!_fileSystem.FileExists(path))
             if (!_fileSystem.FileExists(path))
             {
             {
-                _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                 var imageStream = imageStreams.FirstOrDefault(i => (i.Comment ?? string.Empty).IndexOf("front", StringComparison.OrdinalIgnoreCase) != -1) ??
                 var imageStream = imageStreams.FirstOrDefault(i => (i.Comment ?? string.Empty).IndexOf("front", StringComparison.OrdinalIgnoreCase) != -1) ??
                     imageStreams.FirstOrDefault(i => (i.Comment ?? string.Empty).IndexOf("cover", StringComparison.OrdinalIgnoreCase) != -1) ??
                     imageStreams.FirstOrDefault(i => (i.Comment ?? string.Empty).IndexOf("cover", StringComparison.OrdinalIgnoreCase) != -1) ??

+ 1 - 1
MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs

@@ -254,7 +254,7 @@ namespace MediaBrowser.Providers.Movies
 
 
             var path = GetFanartJsonPath(id);
             var path = GetFanartJsonPath(id);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             try
             try
             {
             {

+ 1 - 1
MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs

@@ -92,7 +92,7 @@ namespace MediaBrowser.Providers.Movies
                     tmdbId = movieInfo.id.ToString(_usCulture);
                     tmdbId = movieInfo.id.ToString(_usCulture);
 
 
                     dataFilePath = MovieDbProvider.Current.GetDataFilePath(tmdbId, language);
                     dataFilePath = MovieDbProvider.Current.GetDataFilePath(tmdbId, language);
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+                    Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
                     _jsonSerializer.SerializeToFile(movieInfo, dataFilePath);
                     _jsonSerializer.SerializeToFile(movieInfo, dataFilePath);
                 }
                 }
             }
             }

+ 1 - 1
MediaBrowser.Providers/Movies/MovieDbProvider.cs

@@ -198,7 +198,7 @@ namespace MediaBrowser.Providers.Movies
 
 
             var dataFilePath = GetDataFilePath(id, preferredMetadataLanguage);
             var dataFilePath = GetDataFilePath(id, preferredMetadataLanguage);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
 
 
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
         }
         }

+ 1 - 1
MediaBrowser.Providers/Music/AudioDbAlbumProvider.cs

@@ -153,7 +153,7 @@ namespace MediaBrowser.Providers.Music
 
 
             var path = GetAlbumInfoPath(_config.ApplicationPaths, musicBrainzReleaseGroupId);
             var path = GetAlbumInfoPath(_config.ApplicationPaths, musicBrainzReleaseGroupId);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             using (var httpResponse = await _httpClient.SendAsync(new HttpRequestOptions
             using (var httpResponse = await _httpClient.SendAsync(new HttpRequestOptions
             {
             {

+ 1 - 1
MediaBrowser.Providers/Music/AudioDbArtistProvider.cs

@@ -151,7 +151,7 @@ namespace MediaBrowser.Providers.Music
             {
             {
                 using (var response = httpResponse.Content)
                 using (var response = httpResponse.Content)
                 {
                 {
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                    Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
                     using (var xmlFileStream = _fileSystem.GetFileStream(path, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     using (var xmlFileStream = _fileSystem.GetFileStream(path, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     {
                     {

+ 1 - 1
MediaBrowser.Providers/Music/FanArtArtistProvider.cs

@@ -233,7 +233,7 @@ namespace MediaBrowser.Providers.Music
 
 
             var jsonPath = GetArtistJsonPath(_config.ApplicationPaths, musicBrainzId);
             var jsonPath = GetArtistJsonPath(_config.ApplicationPaths, musicBrainzId);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(jsonPath));
+            Directory.CreateDirectory(Path.GetDirectoryName(jsonPath));
 
 
             try
             try
             {
             {

+ 2 - 2
MediaBrowser.Providers/Omdb/OmdbProvider.cs

@@ -294,7 +294,7 @@ namespace MediaBrowser.Providers.Omdb
                 using (var stream = response.Content)
                 using (var stream = response.Content)
                 {
                 {
                     var rootObject = await _jsonSerializer.DeserializeFromStreamAsync<RootObject>(stream).ConfigureAwait(false);
                     var rootObject = await _jsonSerializer.DeserializeFromStreamAsync<RootObject>(stream).ConfigureAwait(false);
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                    Directory.CreateDirectory(Path.GetDirectoryName(path));
                     _jsonSerializer.SerializeToFile(rootObject, path);
                     _jsonSerializer.SerializeToFile(rootObject, path);
                 }
                 }
             }
             }
@@ -331,7 +331,7 @@ namespace MediaBrowser.Providers.Omdb
                 using (var stream = response.Content)
                 using (var stream = response.Content)
                 {
                 {
                     var rootObject = await _jsonSerializer.DeserializeFromStreamAsync<SeasonRootObject>(stream).ConfigureAwait(false);
                     var rootObject = await _jsonSerializer.DeserializeFromStreamAsync<SeasonRootObject>(stream).ConfigureAwait(false);
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+                    Directory.CreateDirectory(Path.GetDirectoryName(path));
                     _jsonSerializer.SerializeToFile(rootObject, path);
                     _jsonSerializer.SerializeToFile(rootObject, path);
                 }
                 }
             }
             }

+ 1 - 1
MediaBrowser.Providers/People/MovieDbPersonProvider.cs

@@ -229,7 +229,7 @@ namespace MediaBrowser.Providers.People
             {
             {
                 using (var json = response.Content)
                 using (var json = response.Content)
                 {
                 {
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+                    Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
 
 
                     using (var fs = _fileSystem.GetFileStream(dataFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     using (var fs = _fileSystem.GetFileStream(dataFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     {
                     {

+ 1 - 1
MediaBrowser.Providers/Studios/StudiosImageProvider.cs

@@ -151,7 +151,7 @@ namespace MediaBrowser.Providers.Studios
 
 
                 }).ConfigureAwait(false);
                 }).ConfigureAwait(false);
 
 
-                fileSystem.CreateDirectory(Path.GetDirectoryName(file));
+                Directory.CreateDirectory(Path.GetDirectoryName(file));
 
 
                 try
                 try
                 {
                 {

+ 1 - 1
MediaBrowser.Providers/Subtitles/SubtitleManager.cs

@@ -217,7 +217,7 @@ namespace MediaBrowser.Providers.Subtitles
 
 
                 try
                 try
                 {
                 {
-                    _fileSystem.CreateDirectory(Path.GetDirectoryName(savePath));
+                    Directory.CreateDirectory(Path.GetDirectoryName(savePath));
 
 
                     using (var fs = _fileSystem.GetFileStream(savePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     using (var fs = _fileSystem.GetFileStream(savePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
                     {
                     {

+ 1 - 1
MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs

@@ -298,7 +298,7 @@ namespace MediaBrowser.Providers.TV
 
 
             var path = GetFanartJsonPath(tvdbId);
             var path = GetFanartJsonPath(tvdbId);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
 
 
             try
             try
             {
             {

+ 1 - 1
MediaBrowser.Providers/TV/TheMovieDb/MovieDbProviderBase.cs

@@ -101,7 +101,7 @@ namespace MediaBrowser.Providers.TV
 
 
             var dataFilePath = GetDataFilePath(id, seasonNumber, episodeNumber, preferredMetadataLanguage);
             var dataFilePath = GetDataFilePath(id, seasonNumber, episodeNumber, preferredMetadataLanguage);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
         }
         }
 
 

+ 1 - 1
MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeasonProvider.cs

@@ -188,7 +188,7 @@ namespace MediaBrowser.Providers.TV
 
 
             var dataFilePath = GetDataFilePath(id, seasonNumber, preferredMetadataLanguage);
             var dataFilePath = GetDataFilePath(id, seasonNumber, preferredMetadataLanguage);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
         }
         }
 
 

+ 2 - 2
MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeriesProvider.cs

@@ -187,7 +187,7 @@ namespace MediaBrowser.Providers.TV
             tmdbId = seriesInfo.id.ToString(_usCulture);
             tmdbId = seriesInfo.id.ToString(_usCulture);
 
 
             string dataFilePath = GetDataFilePath(tmdbId, language);
             string dataFilePath = GetDataFilePath(tmdbId, language);
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
             _jsonSerializer.SerializeToFile(seriesInfo, dataFilePath);
             _jsonSerializer.SerializeToFile(seriesInfo, dataFilePath);
 
 
             await EnsureSeriesInfo(tmdbId, language, cancellationToken).ConfigureAwait(false);
             await EnsureSeriesInfo(tmdbId, language, cancellationToken).ConfigureAwait(false);
@@ -351,7 +351,7 @@ namespace MediaBrowser.Providers.TV
 
 
             var dataFilePath = GetDataFilePath(id, preferredMetadataLanguage);
             var dataFilePath = GetDataFilePath(id, preferredMetadataLanguage);
 
 
-            _fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
+            Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
 
 
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
             _jsonSerializer.SerializeToFile(mainResult, dataFilePath);
         }
         }

+ 2 - 2
MediaBrowser.Providers/TV/TheTVDB/TvdbPrescanTask.cs

@@ -82,7 +82,7 @@ namespace MediaBrowser.Providers.TV
         {
         {
             var path = TvdbSeriesProvider.GetSeriesDataPath(_config.CommonApplicationPaths);
             var path = TvdbSeriesProvider.GetSeriesDataPath(_config.CommonApplicationPaths);
 
 
-            _fileSystem.CreateDirectory(path);
+            Directory.CreateDirectory(path);
 
 
             var timestampFile = Path.Combine(path, "time.txt");
             var timestampFile = Path.Combine(path, "time.txt");
 
 
@@ -390,7 +390,7 @@ namespace MediaBrowser.Providers.TV
 
 
             seriesDataPath = Path.Combine(seriesDataPath, id);
             seriesDataPath = Path.Combine(seriesDataPath, id);
 
 
-            _fileSystem.CreateDirectory(seriesDataPath);
+            Directory.CreateDirectory(seriesDataPath);
 
 
             return TvdbSeriesProvider.Current.DownloadSeriesZip(id, MetadataProviders.Tvdb.ToString(), null, null, seriesDataPath, lastTvDbUpdateTime, preferredMetadataLanguage, cancellationToken);
             return TvdbSeriesProvider.Current.DownloadSeriesZip(id, MetadataProviders.Tvdb.ToString(), null, null, seriesDataPath, lastTvDbUpdateTime, preferredMetadataLanguage, cancellationToken);
         }
         }

+ 3 - 3
MediaBrowser.WebDashboard/Api/DashboardService.cs

@@ -390,7 +390,7 @@ namespace MediaBrowser.WebDashboard.Api
             {
             {
                 try
                 try
                 {
                 {
-                    _fileSystem.DeleteDirectory(targetPath, true);
+                    Directory.Delete(targetPath, true);
                 }
                 }
                 catch (IOException)
                 catch (IOException)
                 {
                 {
@@ -435,11 +435,11 @@ namespace MediaBrowser.WebDashboard.Api
 
 
         private void CopyDirectory(string source, string destination)
         private void CopyDirectory(string source, string destination)
         {
         {
-            _fileSystem.CreateDirectory(destination);
+            Directory.CreateDirectory(destination);
 
 
             //Now Create all of the directories
             //Now Create all of the directories
             foreach (var dirPath in _fileSystem.GetDirectories(source, true))
             foreach (var dirPath in _fileSystem.GetDirectories(source, true))
-                _fileSystem.CreateDirectory(dirPath.FullName.Replace(source, destination));
+                Directory.CreateDirectory(dirPath.FullName.Replace(source, destination));
 
 
             //Copy all the files & Replaces any files with the same name
             //Copy all the files & Replaces any files with the same name
             foreach (var newPath in _fileSystem.GetFiles(source, true))
             foreach (var newPath in _fileSystem.GetFiles(source, true))

+ 1 - 1
MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs

@@ -193,7 +193,7 @@ namespace MediaBrowser.XbmcMetadata.Savers
 
 
         private void SaveToFile(Stream stream, string path)
         private void SaveToFile(Stream stream, string path)
         {
         {
-            FileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            Directory.CreateDirectory(Path.GetDirectoryName(path));
             // On Windows, savint the file will fail if the file is hidden or readonly
             // On Windows, savint the file will fail if the file is hidden or readonly
             FileSystem.SetAttributes(path, false, false);
             FileSystem.SetAttributes(path, false, false);