aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-26 22:59:53 +0100
committerErwin de Haan <EraYaN@users.noreply.github.com>2019-01-28 22:10:00 +0100
commit581a7fe078002785b9ba628ec139a42d678cdf25 (patch)
treeab536538f4af5293300f8003e964e0828cb320c8 /MediaBrowser.MediaEncoding
parenta430568082b55f2f989924c59e0729808b39226c (diff)
Unwrapped `MoveDirectory`, `DirectoryExists`, `FileExists` & removed `MoveFile`
Diffstat (limited to 'MediaBrowser.MediaEncoding')
-rw-r--r--MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs2
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs2
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs8
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs10
4 files changed, 11 insertions, 11 deletions
diff --git a/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs b/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs
index 1af4146bc..c20d73dc7 100644
--- a/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs
+++ b/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs
@@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Configuration
&& !string.Equals(oldEncodingConfig.TranscodingTempPath ?? 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/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
index 2d43b8256..d3c44f5eb 100644
--- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
@@ -137,7 +137,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
new JobLogger(Logger).StartStreamingLog(encodingJob, process.StandardError.BaseStream, encodingJob.LogFileStream);
// Wait for the file to exist before proceeeding
- while (!FileSystem.FileExists(encodingJob.OutputFilePath) && !encodingJob.HasExited)
+ while (!File.Exists(encodingJob.OutputFilePath) && !encodingJob.HasExited)
{
await Task.Delay(100, cancellationToken).ConfigureAwait(false);
}
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 92e091dc0..7bcb1e38a 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -214,7 +214,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
throw new ArgumentNullException(nameof(path));
}
- if (!FileSystem.FileExists(path) && !FileSystem.DirectoryExists(path))
+ if (!File.Exists(path) && Directory.Exists(path))
{
throw new ResourceNotFoundException();
}
@@ -288,12 +288,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
if (!string.IsNullOrWhiteSpace(appPath))
{
- if (FileSystem.DirectoryExists(appPath))
+ if (Directory.Exists(appPath))
{
return GetPathsFromDirectory(appPath);
}
- if (FileSystem.FileExists(appPath))
+ if (File.Exists(appPath))
{
return new Tuple<string, string>(appPath, GetProbePathFromEncoderPath(appPath));
}
@@ -336,7 +336,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
var ffmpegPath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffmpeg", StringComparison.OrdinalIgnoreCase) && !excludeExtensions.Contains(Path.GetExtension(i) ?? string.Empty));
var ffprobePath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffprobe", StringComparison.OrdinalIgnoreCase) && !excludeExtensions.Contains(Path.GetExtension(i) ?? string.Empty));
- if (string.IsNullOrWhiteSpace(ffmpegPath) || !FileSystem.FileExists(ffmpegPath))
+ if (string.IsNullOrWhiteSpace(ffmpegPath) || !File.Exists(ffmpegPath))
{
files = FileSystem.GetFilePaths(path, true);
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 849548699..eb62b2b8f 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -386,7 +386,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
try
{
- if (!_fileSystem.FileExists(outputPath))
+ if (!File.Exists(outputPath))
{
await ConvertTextSubtitleToSrtInternal(inputPath, language, inputProtocol, outputPath, cancellationToken).ConfigureAwait(false);
}
@@ -481,7 +481,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
failed = true;
- if (_fileSystem.FileExists(outputPath))
+ if (File.Exists(outputPath))
{
try
{
@@ -494,7 +494,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
}
- else if (!_fileSystem.FileExists(outputPath))
+ else if (!File.Exists(outputPath))
{
failed = true;
}
@@ -537,7 +537,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
try
{
- if (!_fileSystem.FileExists(outputPath))
+ if (!File.Exists(outputPath))
{
await ExtractTextSubtitleInternal(_mediaEncoder.GetInputArgument(inputFiles, protocol), subtitleStreamIndex, outputCodec, outputPath, cancellationToken).ConfigureAwait(false);
}
@@ -634,7 +634,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
_logger.LogError(ex, "Error deleting extracted subtitle {Path}", outputPath);
}
}
- else if (!_fileSystem.FileExists(outputPath))
+ else if (!File.Exists(outputPath))
{
failed = true;
}