aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Images
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-01-08 17:52:50 +0100
committerBond_009 <bond.009@outlook.com>2020-01-22 22:20:35 +0100
commitc8409d2ea1b4843bb89377b130733e61e6dc2e41 (patch)
tree701a0d6f181c23053d9e26ab7f313d739d743e38 /MediaBrowser.Api/Images
parent6eac7f0fa7e753731e3d65c0b6c0323eb730ccd8 (diff)
Remove FileSystem.GetStream
Diffstat (limited to 'MediaBrowser.Api/Images')
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs2
-rw-r--r--MediaBrowser.Api/Images/RemoteImageService.cs6
2 files changed, 3 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index e94c1321f4..c55618aa1d 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -656,7 +656,7 @@ namespace MediaBrowser.Api.Images
IsHeadRequest = isHeadRequest,
Path = imageResult.Item1,
- FileShare = FileShareMode.Read
+ FileShare = FileShare.Read
}).ConfigureAwait(false);
}
diff --git a/MediaBrowser.Api/Images/RemoteImageService.cs b/MediaBrowser.Api/Images/RemoteImageService.cs
index 5a37d37302..f03f5efd8d 100644
--- a/MediaBrowser.Api/Images/RemoteImageService.cs
+++ b/MediaBrowser.Api/Images/RemoteImageService.cs
@@ -274,11 +274,9 @@ namespace MediaBrowser.Api.Images
Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
using (var stream = result.Content)
+ using (var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true))
{
- using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
- {
- await stream.CopyToAsync(filestream).ConfigureAwait(false);
- }
+ await stream.CopyToAsync(filestream).ConfigureAwait(false);
}
Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));