diff options
Diffstat (limited to 'Emby.Server.Implementations')
12 files changed, 30 insertions, 30 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index b9f0701a6..a92185994 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -197,7 +197,7 @@ namespace Emby.Server.Implementations.AppBase && !string.Equals(CommonConfiguration.CachePath ?? string.Empty, newPath)) { // Validate - if (!FileSystem.DirectoryExists(newPath)) + if (!Directory.Exists(newPath)) { throw new FileNotFoundException(string.Format("{0} does not exist.", newPath)); } diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 60cc19db7..454e266f7 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1008,7 +1008,7 @@ namespace Emby.Server.Implementations try { - if (!FileSystemManager.FileExists(certificateLocation)) + if (!File.Exists(certificateLocation)) { return null; } @@ -1434,7 +1434,7 @@ namespace Emby.Server.Implementations //if (generateCertificate) //{ - // if (!FileSystemManager.FileExists(certPath)) + // if (!File.Exists(certPath)) // { // FileSystemManager.CreateDirectory(FileSystemManager.GetDirectoryName(certPath)); diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 1bed65816..c8b822970 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -359,7 +359,7 @@ namespace Emby.Server.Implementations.Collections { var path = _collectionManager.GetCollectionsFolderPath(); - if (_fileSystem.DirectoryExists(path)) + if (Directory.Exists(path)) { try { diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index ab2e1c9a9..18e279c2f 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -148,7 +148,7 @@ namespace Emby.Server.Implementations.Configuration && !string.Equals(Configuration.CertificatePath ?? string.Empty, newPath)) { // Validate - if (!FileSystem.FileExists(newPath)) + if (!File.Exists(newPath)) { throw new FileNotFoundException(string.Format("Certificate file '{0}' does not exist.", newPath)); } @@ -168,7 +168,7 @@ namespace Emby.Server.Implementations.Configuration && !string.Equals(Configuration.MetadataPath ?? string.Empty, newPath)) { // Validate - if (!FileSystem.DirectoryExists(newPath)) + if (!Directory.Exists(newPath)) { throw new FileNotFoundException(string.Format("{0} does not exist.", newPath)); } diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index 1958ae83b..e94a649bf 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -431,7 +431,7 @@ namespace Emby.Server.Implementations.Devices { var path = _deviceManager.GetUploadsPath(); - if (_fileSystem.DirectoryExists(path)) + if (Directory.Exists(path)) { try { diff --git a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs index cf12a8294..79a42f294 100644 --- a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs +++ b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs @@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.FFMpeg var prebuiltFolder = _appPaths.ProgramSystemPath; var prebuiltffmpeg = Path.Combine(prebuiltFolder, downloadInfo.FFMpegFilename); var prebuiltffprobe = Path.Combine(prebuiltFolder, downloadInfo.FFProbeFilename); - if (_fileSystem.FileExists(prebuiltffmpeg) && _fileSystem.FileExists(prebuiltffprobe)) + if (File.Exists(prebuiltffmpeg) && File.Exists(prebuiltffprobe)) { return new FFMpegInfo { @@ -79,7 +79,7 @@ namespace Emby.Server.Implementations.FFMpeg var excludeFromDeletions = new List<string> { versionedDirectoryPath }; - if (!_fileSystem.FileExists(info.ProbePath) || !_fileSystem.FileExists(info.EncoderPath)) + if (!File.Exists(info.ProbePath) || !File.Exists(info.EncoderPath)) { // ffmpeg not present. See if there's an older version we can start with var existingVersion = GetExistingVersion(info, rootEncoderPath); diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index af0c0a6a6..12532a497 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -195,7 +195,7 @@ namespace Emby.Server.Implementations.IO if (item != null) { // If the item has been deleted find the first valid parent that still exists - while (!_fileSystem.DirectoryExists(item.Path) && !_fileSystem.FileExists(item.Path)) + while (!Directory.Exists(item.Path) && !File.Exists(item.Path)) { item = item.GetOwner() ?? item.GetParent(); diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index 45d8104f7..dad81c195 100644 --- a/Emby.Server.Implementations/IO/LibraryMonitor.cs +++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs @@ -277,7 +277,7 @@ namespace Emby.Server.Implementations.IO /// <param name="path">The path.</param> private void StartWatchingPath(string path) { - if (!_fileSystem.DirectoryExists(path)) + if (!Directory.Exists(path)) { // Seeing a crash in the mono runtime due to an exception being thrown on a different thread Logger.LogInformation("Skipping realtime monitor for {0} because the path does not exist", path); diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 7b6372fe8..bf7404824 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -2863,7 +2863,7 @@ namespace Emby.Server.Implementations.Library var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; var virtualFolderPath = Path.Combine(rootFolderPath, name); - while (_fileSystem.DirectoryExists(virtualFolderPath)) + while (Directory.Exists(virtualFolderPath)) { name += "1"; virtualFolderPath = Path.Combine(rootFolderPath, name); @@ -2872,7 +2872,7 @@ namespace Emby.Server.Implementations.Library var mediaPathInfos = options.PathInfos; if (mediaPathInfos != null) { - var invalidpath = mediaPathInfos.FirstOrDefault(i => !_fileSystem.DirectoryExists(i.Path)); + var invalidpath = mediaPathInfos.FirstOrDefault(i => !Directory.Exists(i.Path)); if (invalidpath != null) { throw new ArgumentException("The specified path does not exist: " + invalidpath.Path + "."); @@ -2935,7 +2935,7 @@ namespace Emby.Server.Implementations.Library // // We can't validate protocol-based paths, so just allow them // if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) == -1) // { - // return _fileSystem.DirectoryExists(path); + // return Directory.Exists(path); // } //} @@ -2963,7 +2963,7 @@ namespace Emby.Server.Implementations.Library throw new ArgumentNullException(nameof(path)); } - if (!_fileSystem.DirectoryExists(path)) + if (!Directory.Exists(path)) { throw new FileNotFoundException("The path does not exist."); } @@ -2980,7 +2980,7 @@ namespace Emby.Server.Implementations.Library var lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension); - while (_fileSystem.FileExists(lnk)) + while (File.Exists(lnk)) { shortcutFilename += "1"; lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension); @@ -3073,7 +3073,7 @@ namespace Emby.Server.Implementations.Library var path = Path.Combine(rootFolderPath, name); - if (!_fileSystem.DirectoryExists(path)) + if (!Directory.Exists(path)) { throw new FileNotFoundException("The media folder does not exist"); } @@ -3145,7 +3145,7 @@ namespace Emby.Server.Implementations.Library var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName); - if (!_fileSystem.DirectoryExists(virtualFolderPath)) + if (!Directory.Exists(virtualFolderPath)) { throw new FileNotFoundException(string.Format("The media collection {0} does not exist", virtualFolderName)); } diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 762509e74..6a2a46c9f 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -1427,7 +1427,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV timer.RetryCount++; _timerProvider.AddOrUpdate(timer); } - else if (_fileSystem.FileExists(recordPath)) + else if (File.Exists(recordPath)) { timer.RecordingPath = recordPath; timer.Status = RecordingStatus.Completed; @@ -1573,7 +1573,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV .Where(i => i.Status == RecordingStatus.Completed && !string.IsNullOrWhiteSpace(i.RecordingPath)) .Where(i => string.Equals(i.SeriesTimerId, seriesTimerId, StringComparison.OrdinalIgnoreCase)) .OrderByDescending(i => i.EndDate) - .Where(i => _fileSystem.FileExists(i.RecordingPath)) + .Where(i => File.Exists(i.RecordingPath)) .Skip(seriesTimer.KeepUpTo - 1) .ToList(); @@ -1595,7 +1595,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV DtoOptions = new DtoOptions(true) })) - .Where(i => i.IsFileProtocol && _fileSystem.FileExists(i.Path)) + .Where(i => i.IsFileProtocol && File.Exists(i.Path)) .Skip(seriesTimer.KeepUpTo - 1) .ToList(); @@ -1689,7 +1689,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV private bool FileExists(string path, string timerId) { - if (_fileSystem.FileExists(path)) + if (File.Exists(path)) { return true; } @@ -1961,7 +1961,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { var nfoPath = Path.Combine(seriesPath, "tvshow.nfo"); - if (_fileSystem.FileExists(nfoPath)) + if (File.Exists(nfoPath)) { return; } @@ -2023,7 +2023,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { var nfoPath = Path.ChangeExtension(recordingPath, ".nfo"); - if (_fileSystem.FileExists(nfoPath)) + if (File.Exists(nfoPath)) { return; } @@ -2688,7 +2688,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var defaultFolder = RecordingPath; var defaultName = "Recordings"; - if (_fileSystem.DirectoryExists(defaultFolder)) + if (Directory.Exists(defaultFolder)) { list.Add(new VirtualFolderInfo { @@ -2698,7 +2698,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } var customPath = GetConfiguration().MovieRecordingPath; - if ((!string.IsNullOrWhiteSpace(customPath) && !string.Equals(customPath, defaultFolder, StringComparison.OrdinalIgnoreCase)) && _fileSystem.DirectoryExists(customPath)) + if ((!string.IsNullOrWhiteSpace(customPath) && !string.Equals(customPath, defaultFolder, StringComparison.OrdinalIgnoreCase)) && Directory.Exists(customPath)) { list.Add(new VirtualFolderInfo { @@ -2709,7 +2709,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } customPath = GetConfiguration().SeriesRecordingPath; - if ((!string.IsNullOrWhiteSpace(customPath) && !string.Equals(customPath, defaultFolder, StringComparison.OrdinalIgnoreCase)) && _fileSystem.DirectoryExists(customPath)) + if ((!string.IsNullOrWhiteSpace(customPath) && !string.Equals(customPath, defaultFolder, StringComparison.OrdinalIgnoreCase)) && Directory.Exists(customPath)) { list.Add(new VirtualFolderInfo { diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index dccff6543..f152ac465 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -61,7 +61,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings string cacheFilename = DateTime.UtcNow.DayOfYear.ToString(CultureInfo.InvariantCulture) + "-" + DateTime.UtcNow.Hour.ToString(CultureInfo.InvariantCulture) + ".xml"; string cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename); - if (_fileSystem.FileExists(cacheFile)) + if (File.Exists(cacheFile)) { return UnzipIfNeeded(path, cacheFile); } @@ -255,7 +255,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings public Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings) { // Assume all urls are valid. check files for existence - if (!info.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase) && !_fileSystem.FileExists(info.Path)) + if (!info.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase) && !File.Exists(info.Path)) { throw new FileNotFoundException("Could not find the XmlTv file specified:", info.Path); } diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.cs index 32be5648d..6b8afcb7f 100644 --- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs +++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs @@ -164,7 +164,7 @@ namespace Emby.Server.Implementations.Playlists private string GetTargetPath(string path) { - while (_fileSystem.DirectoryExists(path)) + while (Directory.Exists(path)) { path += "1"; } |
