aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-09-13 17:32:02 -0400
committerLuke <luke.pulverenti@gmail.com>2015-09-13 17:32:02 -0400
commit14de062681026157c6917779a51af6fb7046cec2 (patch)
treefe72ade31e1ef3874e0ed71684fe8ed819e43cc0 /Emby.Drawing/ImageProcessor.cs
parent0f743205c4835d828de9f28f6ab7d325209e83b2 (diff)
update file system methods
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 231bfa2b4..d4fce76d0 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -215,12 +215,12 @@ namespace Emby.Drawing
{
CheckDisposed();
- if (!File.Exists(cacheFilePath))
+ if (!_fileSystem.FileExists(cacheFilePath))
{
var newWidth = Convert.ToInt32(newSize.Width);
var newHeight = Convert.ToInt32(newSize.Height);
- Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
@@ -270,7 +270,7 @@ namespace Emby.Drawing
await semaphore.WaitAsync().ConfigureAwait(false);
// Check again in case of contention
- if (File.Exists(croppedImagePath))
+ if (_fileSystem.FileExists(croppedImagePath))
{
semaphore.Release();
return GetResult(croppedImagePath);
@@ -280,7 +280,7 @@ namespace Emby.Drawing
try
{
- Directory.CreateDirectory(Path.GetDirectoryName(croppedImagePath));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(croppedImagePath));
await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
imageProcessingLockTaken = true;
@@ -366,7 +366,7 @@ namespace Emby.Drawing
/// <returns>ImageSize.</returns>
public ImageSize GetImageSize(string path)
{
- return GetImageSize(path, File.GetLastWriteTimeUtc(path), false);
+ return GetImageSize(path, _fileSystem.GetLastWriteTimeUtc(path), false);
}
public ImageSize GetImageSize(ItemImageInfo info)
@@ -452,7 +452,7 @@ namespace Emby.Drawing
try
{
var path = ImageSizeFile;
- Directory.CreateDirectory(Path.GetDirectoryName(path));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
_jsonSerializer.SerializeToFile(_cachedImagedSizes, path);
}
catch (Exception ex)
@@ -624,7 +624,7 @@ namespace Emby.Drawing
await semaphore.WaitAsync().ConfigureAwait(false);
// Check again in case of contention
- if (File.Exists(enhancedImagePath))
+ if (_fileSystem.FileExists(enhancedImagePath))
{
semaphore.Release();
return enhancedImagePath;
@@ -634,7 +634,7 @@ namespace Emby.Drawing
try
{
- Directory.CreateDirectory(Path.GetDirectoryName(enhancedImagePath));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(enhancedImagePath));
await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);