Unwrapped GetDirectoryName and DirectorySeperatorChar
This commit is contained in:
parent
a05d803d4c
commit
3a831994f6
|
@ -92,7 +92,7 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
DirectoryRoot =
|
||||
_fileSystem.GetDirectoryInfo(_fileSystem.GetDirectoryName(DirectoryBDMV.FullName));
|
||||
_fileSystem.GetDirectoryInfo(Path.GetDirectoryName(DirectoryBDMV.FullName));
|
||||
DirectoryBDJO =
|
||||
GetDirectory("BDJO", DirectoryBDMV, 0);
|
||||
DirectoryCLIPINF =
|
||||
|
@ -345,7 +345,7 @@ namespace BDInfo
|
|||
{
|
||||
return dir;
|
||||
}
|
||||
var parentFolder = _fileSystem.GetDirectoryName(dir.FullName);
|
||||
var parentFolder = Path.GetDirectoryName(dir.FullName);
|
||||
if (string.IsNullOrEmpty(parentFolder))
|
||||
{
|
||||
dir = null;
|
||||
|
|
|
@ -631,7 +631,7 @@ namespace Emby.Drawing
|
|||
return (enhancedImagePath, treatmentRequiresTransparency);
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(enhancedImagePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(enhancedImagePath));
|
||||
|
||||
await ExecuteImageEnhancers(supportedEnhancers, originalImagePath, enhancedImagePath, item, imageType, imageIndex).ConfigureAwait(false);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace IsoMounter
|
|||
_logger = logger;
|
||||
ProcessFactory = processFactory;
|
||||
|
||||
MountPointRoot = FileSystem.DirectorySeparatorChar + "tmp" + FileSystem.DirectorySeparatorChar + "Emby";
|
||||
MountPointRoot = Path.DirectorySeparatorChar + "tmp" + Path.DirectorySeparatorChar + "Emby";
|
||||
|
||||
_logger.LogDebug(
|
||||
"[{0}] System PATH is currently set to [{1}].",
|
||||
|
@ -216,7 +216,7 @@ namespace IsoMounter
|
|||
|
||||
if (!string.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name)))
|
||||
{
|
||||
return FileSystem.GetFullPath(path);
|
||||
return Path.GetFullPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace Emby.Server.Implementations.AppBase
|
|||
Logger.LogInformation("Saving system configuration");
|
||||
var path = CommonApplicationPaths.SystemConfigurationFilePath;
|
||||
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_configurationSyncLock)
|
||||
{
|
||||
|
@ -294,7 +294,7 @@ namespace Emby.Server.Implementations.AppBase
|
|||
_configurations.AddOrUpdate(key, configuration, (k, v) => configuration);
|
||||
|
||||
var path = GetConfigurationFile(key);
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_configurationSyncLock)
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.AppBase
|
|||
// If the file didn't exist before, or if something has changed, re-save
|
||||
if (buffer == null || !buffer.SequenceEqual(newBytes))
|
||||
{
|
||||
fileSystem.CreateDirectory(fileSystem.GetDirectoryName(path));
|
||||
fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
// Save it after load in case we got new items
|
||||
fileSystem.WriteAllBytes(path, newBytes);
|
||||
|
|
|
@ -355,7 +355,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
return;
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
_jsonSerializer.SerializeToFile(mediaSources, path);
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
{
|
||||
try
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
_jsonSerializer.SerializeToFile(result, path);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
{
|
||||
var path = CachePath;
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_syncLock)
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
public void SaveCapabilities(string deviceId, ClientCapabilities capabilities)
|
||||
{
|
||||
var path = Path.Combine(GetDevicePath(deviceId), "capabilities.json");
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_capabilitiesSyncLock)
|
||||
{
|
||||
|
@ -239,7 +239,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
path = Path.Combine(path, file.Name);
|
||||
path = Path.ChangeExtension(path, MimeTypes.ToExtension(file.MimeType) ?? "jpg");
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
await EnsureLibraryFolder(uploadPathInfo.Item2, uploadPathInfo.Item3).ConfigureAwait(false);
|
||||
|
||||
|
@ -275,7 +275,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
private void AddCameraUpload(string deviceId, LocalFileInfo file)
|
||||
{
|
||||
var path = Path.Combine(GetDevicePath(deviceId), "camerauploads.json");
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_cameraUploadSyncLock)
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace Emby.Server.Implementations.FFMpeg
|
|||
else
|
||||
{
|
||||
info = existingVersion;
|
||||
versionedDirectoryPath = _fileSystem.GetDirectoryName(info.EncoderPath);
|
||||
versionedDirectoryPath = Path.GetDirectoryName(info.EncoderPath);
|
||||
excludeFromDeletions.Add(versionedDirectoryPath);
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ namespace Emby.Server.Implementations.FFMpeg
|
|||
{
|
||||
EncoderPath = encoder,
|
||||
ProbePath = probe,
|
||||
Version = Path.GetFileName(_fileSystem.GetDirectoryName(probe))
|
||||
Version = Path.GetFileName(Path.GetDirectoryName(probe))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
|
||||
private async Task CacheResponse(HttpResponseInfo response, string responseCachePath)
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(responseCachePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(responseCachePath));
|
||||
|
||||
using (var fileStream = _fileSystem.GetFileStream(responseCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.None, true))
|
||||
{
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
item = LibraryManager.FindByPath(path, null);
|
||||
|
||||
path = _fileSystem.GetDirectoryName(path);
|
||||
path = System.IO.Path.GetDirectoryName(path);
|
||||
}
|
||||
|
||||
if (item != null)
|
||||
|
|
|
@ -483,7 +483,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
|
||||
// Go up a level
|
||||
var parent = _fileSystem.GetDirectoryName(i);
|
||||
var parent = Path.GetDirectoryName(i);
|
||||
if (!string.IsNullOrEmpty(parent))
|
||||
{
|
||||
if (_fileSystem.AreEqual(parent, path))
|
||||
|
@ -509,7 +509,7 @@ namespace Emby.Server.Implementations.IO
|
|||
|
||||
private void CreateRefresher(string path)
|
||||
{
|
||||
var parentPath = _fileSystem.GetDirectoryName(path);
|
||||
var parentPath = Path.GetDirectoryName(path);
|
||||
|
||||
lock (_activeRefreshers)
|
||||
{
|
||||
|
@ -538,7 +538,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
|
||||
// They are siblings. Rebase the refresher to the parent folder.
|
||||
if (string.Equals(parentPath, _fileSystem.GetDirectoryName(refresher.Path), StringComparison.Ordinal))
|
||||
if (string.Equals(parentPath, Path.GetDirectoryName(refresher.Path), StringComparison.Ordinal))
|
||||
{
|
||||
refresher.ResetPath(parentPath, path);
|
||||
return;
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace Emby.Server.Implementations.Images
|
|||
CancellationToken cancellationToken)
|
||||
{
|
||||
var outputPathWithoutExtension = Path.Combine(ApplicationPaths.TempDirectory, Guid.NewGuid().ToString("N"));
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(outputPathWithoutExtension));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(outputPathWithoutExtension));
|
||||
string outputPath = CreateImage(item, itemsWithImages, outputPathWithoutExtension, imageType, 0);
|
||||
|
||||
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)
|
||||
{
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(outputPath));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
var options = new ImageCollageOptions
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
|
@ -146,7 +147,7 @@ namespace Emby.Server.Implementations.Library
|
|||
if (parent != null)
|
||||
{
|
||||
// Don't resolve these into audio files
|
||||
if (string.Equals(_fileSystem.GetFileNameWithoutExtension(filename), BaseItem.ThemeSongFilename) && _libraryManager.IsAudioFile(filename))
|
||||
if (string.Equals(Path.GetFileNameWithoutExtension(filename), BaseItem.ThemeSongFilename) && _libraryManager.IsAudioFile(filename))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1228,7 +1228,7 @@ namespace Emby.Server.Implementations.Library
|
|||
private string GetCollectionType(string path)
|
||||
{
|
||||
return _fileSystem.GetFilePaths(path, new[] { ".collection" }, true, false)
|
||||
.Select(i => _fileSystem.GetFileNameWithoutExtension(i))
|
||||
.Select(i => Path.GetFileNameWithoutExtension(i))
|
||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
}
|
||||
|
||||
|
@ -2976,7 +2976,7 @@ namespace Emby.Server.Implementations.Library
|
|||
var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
|
||||
var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName);
|
||||
|
||||
var shortcutFilename = _fileSystem.GetFileNameWithoutExtension(path);
|
||||
var shortcutFilename = Path.GetFileNameWithoutExtension(path);
|
||||
|
||||
var lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension);
|
||||
|
||||
|
|
|
@ -670,7 +670,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (cacheFilePath != null)
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
|
||||
_jsonSerializer.SerializeToFile(mediaInfo, cacheFilePath);
|
||||
|
||||
//_logger.LogDebug("Saved media info to {0}", cacheFilePath);
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
|||
var filename = Path.GetFileNameWithoutExtension(args.Path);
|
||||
|
||||
// Make sure the image doesn't belong to a video file
|
||||
var files = args.DirectoryService.GetFiles(_fileSystem.GetDirectoryName(args.Path));
|
||||
var files = args.DirectoryService.GetFiles(Path.GetDirectoryName(args.Path));
|
||||
var libraryOptions = args.GetLibraryOptions();
|
||||
|
||||
foreach (var file in files)
|
||||
|
|
|
@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
var path = GetPolicyFilePath(user);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_policySyncLock)
|
||||
{
|
||||
|
@ -1176,7 +1176,7 @@ namespace Emby.Server.Implementations.Library
|
|||
config = _jsonSerializer.DeserializeFromString<UserConfiguration>(json);
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_configSyncLock)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Net;
|
||||
|
@ -41,7 +42,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
|
||||
private async Task RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(targetFile));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(targetFile));
|
||||
|
||||
using (var output = _fileSystem.GetFileStream(targetFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
|
||||
{
|
||||
|
@ -77,7 +78,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
{
|
||||
_logger.LogInformation("Opened recording stream from tuner provider");
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(targetFile));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(targetFile));
|
||||
|
||||
using (var output = _fileSystem.GetFileStream(targetFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
|
||||
{
|
||||
|
|
|
@ -1489,7 +1489,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
{
|
||||
_logger.LogInformation("Triggering refresh on {path}", path);
|
||||
|
||||
var item = GetAffectedBaseItem(_fileSystem.GetDirectoryName(path));
|
||||
var item = GetAffectedBaseItem(Path.GetDirectoryName(path));
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
|
@ -1500,8 +1500,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
RefreshPaths = new string[]
|
||||
{
|
||||
path,
|
||||
_fileSystem.GetDirectoryName(path),
|
||||
_fileSystem.GetDirectoryName(_fileSystem.GetDirectoryName(path))
|
||||
Path.GetDirectoryName(path),
|
||||
Path.GetDirectoryName(Path.GetDirectoryName(path))
|
||||
}
|
||||
|
||||
}, RefreshPriority.High);
|
||||
|
@ -1512,13 +1512,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
{
|
||||
BaseItem item = null;
|
||||
|
||||
var parentPath = _fileSystem.GetDirectoryName(path);
|
||||
var parentPath = Path.GetDirectoryName(path);
|
||||
|
||||
while (item == null && !string.IsNullOrEmpty(path))
|
||||
{
|
||||
item = _libraryManager.FindByPath(path, null);
|
||||
|
||||
path = _fileSystem.GetDirectoryName(path);
|
||||
path = Path.GetDirectoryName(path);
|
||||
}
|
||||
|
||||
if (item != null)
|
||||
|
@ -1676,7 +1676,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
|
||||
while (FileExists(path, timerId))
|
||||
{
|
||||
var parent = _fileSystem.GetDirectoryName(originalPath);
|
||||
var parent = Path.GetDirectoryName(originalPath);
|
||||
var name = Path.GetFileNameWithoutExtension(originalPath);
|
||||
name += " - " + index.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
|
@ -1822,7 +1822,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
return;
|
||||
}
|
||||
|
||||
var imageSavePath = Path.Combine(_fileSystem.GetDirectoryName(recordingPath), imageSaveFilenameWithoutExtension);
|
||||
var imageSavePath = Path.Combine(Path.GetDirectoryName(recordingPath), imageSaveFilenameWithoutExtension);
|
||||
|
||||
// preserve original image extension
|
||||
imageSavePath = Path.ChangeExtension(imageSavePath, Path.GetExtension(image.Path));
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
_targetPath = targetFile;
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(targetFile));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(targetFile));
|
||||
|
||||
var process = _processFactory.Create(new ProcessOptions
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
_logger.LogInformation(commandLineLogMessage);
|
||||
|
||||
var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "record-transcode-" + Guid.NewGuid() + ".txt");
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(logFilePath));
|
||||
_fileSystem.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.
|
||||
_logFileStream = _fileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
}
|
||||
|
||||
var file = _dataPath + ".json";
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(file));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(file));
|
||||
|
||||
lock (_fileDataLock)
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings
|
|||
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFile));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(cacheFile));
|
||||
|
||||
_fileSystem.CopyFile(tempFile, cacheFile, true);
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|||
{
|
||||
try
|
||||
{
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(channelCacheFile));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(channelCacheFile));
|
||||
JsonSerializer.SerializeToFile(channels, channelCacheFile);
|
||||
}
|
||||
catch (IOException)
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|||
var uri = new Uri(mediaSource.Path);
|
||||
var localPort = _networkManager.GetRandomUnusedUdpPort();
|
||||
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(TempFilePath));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(TempFilePath));
|
||||
|
||||
Logger.LogInformation("Opening HDHR UDP Live stream from {host}", uri.Host);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Net;
|
||||
|
@ -35,7 +36,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|||
|
||||
var url = mediaSource.Path;
|
||||
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(TempFilePath));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(TempFilePath));
|
||||
|
||||
var typeName = GetType().Name;
|
||||
Logger.LogInformation("Opening " + typeName + " Live stream from {0}", url);
|
||||
|
|
|
@ -337,7 +337,7 @@ namespace Emby.Server.Implementations.Localization
|
|||
.Where(i => i != null)
|
||||
.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var countryCode = _fileSystem.GetFileNameWithoutExtension(file)
|
||||
var countryCode = Path.GetFileNameWithoutExtension(file)
|
||||
.Split('-')
|
||||
.Last();
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.MediaEncoder
|
|||
|
||||
var inputPath = MediaEncoderHelpers.GetInputArgument(_fileSystem, video.Path, protocol, null, Array.Empty<string>());
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
var container = video.Container;
|
||||
|
||||
|
|
|
@ -455,7 +455,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
|
||||
private string NormalizeItemPath(string playlistPath, string itemPath)
|
||||
{
|
||||
return MakeRelativePath(_fileSystem.GetDirectoryName(playlistPath), itemPath);
|
||||
return MakeRelativePath(Path.GetDirectoryName(playlistPath), itemPath);
|
||||
}
|
||||
|
||||
private static string MakeRelativePath(string folderPath, string fileAbsolutePath)
|
||||
|
|
|
@ -42,11 +42,11 @@ namespace Emby.Server.Implementations
|
|||
|
||||
private string GetResourcePath(string basePath, string virtualPath)
|
||||
{
|
||||
var fullPath = Path.Combine(basePath, virtualPath.Replace('/', _fileSystem.DirectorySeparatorChar));
|
||||
var fullPath = Path.Combine(basePath, virtualPath.Replace('/', Path.DirectorySeparatorChar));
|
||||
|
||||
try
|
||||
{
|
||||
fullPath = _fileSystem.GetFullPath(fullPath);
|
||||
fullPath = Path.GetFullPath(fullPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -139,7 +139,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||
{
|
||||
previouslyFailedImages.Add(key);
|
||||
|
||||
var parentPath = _fileSystem.GetDirectoryName(failHistoryPath);
|
||||
var parentPath = Path.GetDirectoryName(failHistoryPath);
|
||||
|
||||
_fileSystem.CreateDirectory(parentPath);
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||
_lastExecutionResult = value;
|
||||
|
||||
var path = GetHistoryFilePath();
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
lock (_lastExecutionResultSyncLock)
|
||||
{
|
||||
|
@ -565,7 +565,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||
{
|
||||
var path = GetConfigurationFilePath();
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
JsonSerializer.SerializeToFile(triggers, path);
|
||||
}
|
||||
|
|
|
@ -570,7 +570,7 @@ namespace Emby.Server.Implementations.Updates
|
|||
// Success - move it to the real target
|
||||
try
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(target));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(target));
|
||||
_fileSystem.CopyFile(tempFile, target, true);
|
||||
//If it is an archive - write out a version file so we know what it is
|
||||
if (isArchive)
|
||||
|
@ -611,7 +611,7 @@ namespace Emby.Server.Implementations.Updates
|
|||
_logger.LogInformation("Deleting plugin file {0}", path);
|
||||
|
||||
// Make this case-insensitive to account for possible incorrect assembly naming
|
||||
var file = _fileSystem.GetFilePaths(_fileSystem.GetDirectoryName(path))
|
||||
var file = _fileSystem.GetFilePaths(Path.GetDirectoryName(path))
|
||||
.FirstOrDefault(i => string.Equals(i, path, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(file))
|
||||
|
|
|
@ -219,7 +219,7 @@ namespace Jellyfin.Drawing.Skia
|
|||
|
||||
var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path) ?? string.Empty);
|
||||
|
||||
fileSystem.CreateDirectory(fileSystem.GetDirectoryName(tempPath));
|
||||
fileSystem.CreateDirectory(Path.GetDirectoryName(tempPath));
|
||||
fileSystem.CopyFile(path, tempPath, true);
|
||||
|
||||
return tempPath;
|
||||
|
@ -532,7 +532,7 @@ namespace Jellyfin.Drawing.Skia
|
|||
// If all we're doing is resizing then we can stop now
|
||||
if (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), resizedBitmap.GetPixels()))
|
||||
{
|
||||
|
@ -584,7 +584,7 @@ namespace Jellyfin.Drawing.Skia
|
|||
DrawIndicator(canvas, width, height, options);
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
{
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels()))
|
||||
|
|
|
@ -646,7 +646,7 @@ namespace MediaBrowser.Api
|
|||
/// <param name="outputFilePath">The output file path.</param>
|
||||
private void DeleteHlsPartialStreamFiles(string outputFilePath)
|
||||
{
|
||||
var directory = _fileSystem.GetDirectoryName(outputFilePath);
|
||||
var directory = Path.GetDirectoryName(outputFilePath);
|
||||
var name = Path.GetFileNameWithoutExtension(outputFilePath);
|
||||
|
||||
var filesToDelete = _fileSystem.GetFilePaths(directory)
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
public object Get(GetParentPath request)
|
||||
{
|
||||
var parent = _fileSystem.GetDirectoryName(request.Path);
|
||||
var parent = Path.GetDirectoryName(request.Path);
|
||||
|
||||
if (string.IsNullOrEmpty(parent))
|
||||
{
|
||||
|
|
|
@ -158,7 +158,7 @@ namespace MediaBrowser.Api.Images
|
|||
|
||||
private string GetThemeName(string path, string rootImagePath)
|
||||
{
|
||||
var parentName = _fileSystem.GetDirectoryName(path);
|
||||
var parentName = Path.GetDirectoryName(path);
|
||||
|
||||
if (string.Equals(parentName, rootImagePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
|
|
@ -264,7 +264,7 @@ namespace MediaBrowser.Api.Images
|
|||
|
||||
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(fullCachePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(fullCachePath));
|
||||
using (var stream = result.Content)
|
||||
{
|
||||
using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
|
||||
|
@ -273,7 +273,7 @@ namespace MediaBrowser.Api.Images
|
|||
}
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(pointerCachePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
|
||||
_fileSystem.WriteAllText(pointerCachePath, fullCachePath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(fullCachePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(fullCachePath));
|
||||
using (var stream = result.Content)
|
||||
{
|
||||
using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
|
||||
|
@ -314,7 +314,7 @@ namespace MediaBrowser.Api
|
|||
}
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(pointerCachePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
|
||||
_fileSystem.WriteAllText(pointerCachePath, fullCachePath);
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ namespace MediaBrowser.Api.Playback
|
|||
CancellationTokenSource cancellationTokenSource,
|
||||
string workingDirectory = null)
|
||||
{
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(outputPath));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
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");
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(logFilePath));
|
||||
FileSystem.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.
|
||||
state.LogFileStream = FileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);
|
||||
|
|
|
@ -264,7 +264,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
var useGenericSegmenter = true;
|
||||
if (useGenericSegmenter)
|
||||
{
|
||||
var outputTsArg = Path.Combine(FileSystem.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request);
|
||||
var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request);
|
||||
|
||||
var timeDeltaParam = string.Empty;
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
|
||||
private static FileSystemMetadata GetLastTranscodingFile(string playlist, string segmentExtension, IFileSystem fileSystem)
|
||||
{
|
||||
var folder = fileSystem.GetDirectoryName(playlist);
|
||||
var folder = Path.GetDirectoryName(playlist);
|
||||
|
||||
var filePrefix = Path.GetFileNameWithoutExtension(playlist) ?? string.Empty;
|
||||
|
||||
|
@ -418,7 +418,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
|
||||
private string GetSegmentPath(StreamState state, string playlist, int index)
|
||||
{
|
||||
var folder = FileSystem.GetDirectoryName(playlist);
|
||||
var folder = Path.GetDirectoryName(playlist);
|
||||
|
||||
var filename = Path.GetFileNameWithoutExtension(playlist);
|
||||
|
||||
|
@ -932,7 +932,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
|
||||
var mapArgs = state.IsOutputVideo ? EncodingHelper.GetMapArgs(state) : string.Empty;
|
||||
|
||||
var outputTsArg = Path.Combine(FileSystem.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request);
|
||||
var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request);
|
||||
|
||||
var timeDeltaParam = string.Empty;
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
return Path;
|
||||
}
|
||||
|
||||
return FileSystem.GetDirectoryName(Path);
|
||||
return System.IO.Path.GetDirectoryName(Path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2208,7 +2208,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
var allFiles = ImageInfos
|
||||
.Where(i => i.IsLocalFile)
|
||||
.Select(i => FileSystem.GetDirectoryName(i.Path))
|
||||
.Select(i => System.IO.Path.GetDirectoryName(i.Path))
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.SelectMany(i => directoryService.GetFilePaths(i))
|
||||
.ToList();
|
||||
|
@ -2396,7 +2396,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
var extensions = new List<string> { ".nfo", ".xml", ".srt", ".vtt", ".sub", ".idx", ".txt", ".edl", ".bif", ".smi", ".ttml" };
|
||||
extensions.AddRange(SupportedImageExtensions);
|
||||
|
||||
return FileSystem.GetFiles(FileSystem.GetDirectoryName(Path), extensions.ToArray(), false, false)
|
||||
return FileSystem.GetFiles(System.IO.Path.GetDirectoryName(Path), extensions.ToArray(), false, false)
|
||||
.Where(i => System.IO.Path.GetFileNameWithoutExtension(i.FullName).StartsWith(filename, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
return new[] {
|
||||
new FileSystemMetadata
|
||||
{
|
||||
FullName = FileSystem.GetDirectoryName(Path),
|
||||
FullName = System.IO.Path.GetDirectoryName(Path),
|
||||
IsDirectory = true
|
||||
}
|
||||
};
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
return series.Path;
|
||||
}
|
||||
|
||||
return FileSystem.GetDirectoryName(Path);
|
||||
return System.IO.Path.GetDirectoryName(Path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
if (IsStacked)
|
||||
{
|
||||
return FileSystem.GetDirectoryName(Path);
|
||||
return System.IO.Path.GetDirectoryName(Path);
|
||||
}
|
||||
|
||||
if (!IsPlaceHolder)
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace MediaBrowser.Controller.Library
|
|||
return false;
|
||||
}
|
||||
|
||||
var parentDir = BaseItem.FileSystem.GetDirectoryName(Path) ?? string.Empty;
|
||||
var parentDir = System.IO.Path.GetDirectoryName(Path) ?? string.Empty;
|
||||
|
||||
return parentDir.Length > _appPaths.RootFolderPath.Length
|
||||
&& parentDir.StartsWith(_appPaths.RootFolderPath, StringComparison.OrdinalIgnoreCase);
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Playlists
|
|||
|
||||
if (IsPlaylistFile(path))
|
||||
{
|
||||
return FileSystem.GetDirectoryName(path);
|
||||
return System.IO.Path.GetDirectoryName(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
|
@ -29,7 +30,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
|
||||
public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService)
|
||||
{
|
||||
var parentPath = _fileSystem.GetDirectoryName(item.Path);
|
||||
var parentPath = Path.GetDirectoryName(item.Path);
|
||||
|
||||
var parentPathFiles = directoryService.GetFiles(parentPath);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace MediaBrowser.LocalMetadata.Providers
|
|||
var specificFile = Path.ChangeExtension(info.Path, ".xml");
|
||||
var file = FileSystem.GetFileInfo(specificFile);
|
||||
|
||||
return info.IsInMixedFolder || file.Exists ? file : FileSystem.GetFileInfo(Path.Combine(FileSystem.GetDirectoryName(info.Path), "game.xml"));
|
||||
return info.IsInMixedFolder || file.Exists ? file : FileSystem.GetFileInfo(Path.Combine(Path.GetDirectoryName(info.Path), "game.xml"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace MediaBrowser.LocalMetadata.Savers
|
|||
|
||||
private void SaveToFile(Stream stream, string path)
|
||||
{
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
// On Windows, savint the file will fail if the file is hidden or readonly
|
||||
FileSystem.SetAttributes(path, false, false);
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
.CreateJob(options, EncodingHelper, IsVideoEncoder, progress, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
encodingJob.OutputFilePath = GetOutputFilePath(encodingJob);
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(encodingJob.OutputFilePath));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(encodingJob.OutputFilePath));
|
||||
|
||||
encodingJob.ReadInputAtNativeFramerate = options.ReadInputAtNativeFramerate;
|
||||
|
||||
|
@ -105,7 +105,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
Logger.LogInformation(commandLineLogMessage);
|
||||
|
||||
var logFilePath = Path.Combine(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, "transcode-" + Guid.NewGuid() + ".txt");
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(logFilePath));
|
||||
FileSystem.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.
|
||||
encodingJob.LogFileStream = FileSystem.GetFileStream(logFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true);
|
||||
|
|
|
@ -353,7 +353,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
private string GetProbePathFromEncoderPath(string appPath)
|
||||
{
|
||||
return FileSystem.GetFilePaths(FileSystem.GetDirectoryName(appPath))
|
||||
return FileSystem.GetFilePaths(Path.GetDirectoryName(appPath))
|
||||
.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffprobe", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
|
@ -608,7 +608,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
}
|
||||
|
||||
var tempExtractPath = Path.Combine(ConfigurationManager.ApplicationPaths.TempDirectory, Guid.NewGuid() + ".jpg");
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(tempExtractPath));
|
||||
FileSystem.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.
|
||||
// This filter chain may have adverse effects on recorded tv thumbnails if ar changes during presentation ex. commercials @ diff ar
|
||||
|
|
|
@ -422,7 +422,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
throw new ArgumentNullException(nameof(outputPath));
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
var encodingParam = await GetSubtitleFileCharacterSet(inputPath, language, inputProtocol, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
@ -565,7 +565,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
throw new ArgumentNullException(nameof(outputPath));
|
||||
}
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
var processArgs = string.Format("-i {0} -map 0:{1} -an -vn -c:s {2} \"{3}\"", inputPath,
|
||||
subtitleStreamIndex, outputCodec, outputPath);
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace MediaBrowser.Providers.BoxSets
|
|||
|
||||
var dataFilePath = GetDataFilePath(_config.ApplicationPaths, tmdbId, preferredMetadataLanguage);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
|
||||
_json.SerializeToFile(mainResult, dataFilePath);
|
||||
}
|
||||
|
|
|
@ -233,14 +233,14 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
_logger.LogDebug("Saving image to {0}", path);
|
||||
|
||||
var parentFolder = _fileSystem.GetDirectoryName(path);
|
||||
var parentFolder = Path.GetDirectoryName(path);
|
||||
|
||||
try
|
||||
{
|
||||
_libraryMonitor.ReportFileSystemChangeBeginning(path);
|
||||
_libraryMonitor.ReportFileSystemChangeBeginning(parentFolder);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
_fileSystem.SetAttributes(path, false, false);
|
||||
|
||||
|
@ -437,7 +437,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
if (type == ImageType.Primary && item is Episode)
|
||||
{
|
||||
path = Path.Combine(_fileSystem.GetDirectoryName(item.Path), "metadata", filename + extension);
|
||||
path = Path.Combine(Path.GetDirectoryName(item.Path), "metadata", filename + extension);
|
||||
}
|
||||
|
||||
else if (item.IsInMixedFolder)
|
||||
|
@ -569,7 +569,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
if (item is Episode)
|
||||
{
|
||||
var seasonFolder = _fileSystem.GetDirectoryName(item.Path);
|
||||
var seasonFolder = Path.GetDirectoryName(item.Path);
|
||||
|
||||
var imageFilename = _fileSystem.GetFileNameWithoutExtension(item.Path) + "-thumb" + extension;
|
||||
|
||||
|
@ -617,7 +617,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
imageFilename = "poster";
|
||||
}
|
||||
var folder = _fileSystem.GetDirectoryName(item.Path);
|
||||
var folder = Path.GetDirectoryName(item.Path);
|
||||
|
||||
return Path.Combine(folder, _fileSystem.GetFileNameWithoutExtension(item.Path) + "-" + imageFilename + extension);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
|
||||
if (!_fileSystem.FileExists(path))
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
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) ??
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
var path = GetFanartJsonPath(id);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
|
@ -91,7 +92,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
tmdbId = movieInfo.id.ToString(_usCulture);
|
||||
|
||||
dataFilePath = MovieDbProvider.Current.GetDataFilePath(tmdbId, language);
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
_jsonSerializer.SerializeToFile(movieInfo, dataFilePath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
var dataFilePath = GetDataFilePath(id, preferredMetadataLanguage);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
|
||||
_jsonSerializer.SerializeToFile(mainResult, dataFilePath);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
var path = GetAlbumInfoPath(_config.ApplicationPaths, musicBrainzReleaseGroupId);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
using (var httpResponse = await _httpClient.SendAsync(new HttpRequestOptions
|
||||
{
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
using (var response = httpResponse.Content)
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
using (var xmlFileStream = _fileSystem.GetFileStream(path, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
|
||||
{
|
||||
|
|
|
@ -233,7 +233,7 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
var jsonPath = GetArtistJsonPath(_config.ApplicationPaths, musicBrainzId);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(jsonPath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(jsonPath));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -294,7 +294,7 @@ namespace MediaBrowser.Providers.Omdb
|
|||
using (var stream = response.Content)
|
||||
{
|
||||
var rootObject = await _jsonSerializer.DeserializeFromStreamAsync<RootObject>(stream).ConfigureAwait(false);
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
_jsonSerializer.SerializeToFile(rootObject, path);
|
||||
}
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ namespace MediaBrowser.Providers.Omdb
|
|||
using (var stream = response.Content)
|
||||
{
|
||||
var rootObject = await _jsonSerializer.DeserializeFromStreamAsync<SeasonRootObject>(stream).ConfigureAwait(false);
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
_jsonSerializer.SerializeToFile(rootObject, path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ namespace MediaBrowser.Providers.People
|
|||
{
|
||||
using (var json = response.Content)
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
|
||||
using (var fs = _fileSystem.GetFileStream(dataFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
|
||||
{
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace MediaBrowser.Providers.Studios
|
|||
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
fileSystem.CreateDirectory(fileSystem.GetDirectoryName(file));
|
||||
fileSystem.CreateDirectory(Path.GetDirectoryName(file));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -217,7 +217,7 @@ namespace MediaBrowser.Providers.Subtitles
|
|||
|
||||
try
|
||||
{
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(savePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(savePath));
|
||||
|
||||
using (var fs = _fileSystem.GetFileStream(savePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
|
||||
{
|
||||
|
|
|
@ -298,7 +298,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
var path = GetFanartJsonPath(tvdbId);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
var dataFilePath = GetDataFilePath(id, seasonNumber, episodeNumber, preferredMetadataLanguage);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
_jsonSerializer.SerializeToFile(mainResult, dataFilePath);
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
var dataFilePath = GetDataFilePath(id, seasonNumber, preferredMetadataLanguage);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
_jsonSerializer.SerializeToFile(mainResult, dataFilePath);
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ namespace MediaBrowser.Providers.TV
|
|||
tmdbId = seriesInfo.id.ToString(_usCulture);
|
||||
|
||||
string dataFilePath = GetDataFilePath(tmdbId, language);
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
_jsonSerializer.SerializeToFile(seriesInfo, dataFilePath);
|
||||
|
||||
await EnsureSeriesInfo(tmdbId, language, cancellationToken).ConfigureAwait(false);
|
||||
|
@ -351,7 +351,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
var dataFilePath = GetDataFilePath(id, preferredMetadataLanguage);
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath));
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(dataFilePath));
|
||||
|
||||
_jsonSerializer.SerializeToFile(mainResult, dataFilePath);
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
if (searchInfo.IndexNumber.HasValue)
|
||||
{
|
||||
var files = GetEpisodeXmlFiles(searchInfo.SeriesDisplayOrder, searchInfo.ParentIndexNumber, searchInfo.IndexNumber, searchInfo.IndexNumberEnd, _fileSystem.GetDirectoryName(xmlFile));
|
||||
var files = GetEpisodeXmlFiles(searchInfo.SeriesDisplayOrder, searchInfo.ParentIndexNumber, searchInfo.IndexNumber, searchInfo.IndexNumberEnd, Path.GetDirectoryName(xmlFile));
|
||||
|
||||
list = files.Select(GetXmlReader).ToList();
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
|||
|
||||
private void SaveToFile(Stream stream, string path)
|
||||
{
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
|
||||
FileSystem.CreateDirectory(Path.GetDirectoryName(path));
|
||||
// On Windows, savint the file will fail if the file is hidden or readonly
|
||||
FileSystem.SetAttributes(path, false, false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user