aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-11-03 14:16:30 -0400
committerGitHub <noreply@github.com>2017-11-03 14:16:30 -0400
commit2bffe246eb6697efedae7a30e9feeebca1ccf12f (patch)
treeefd9c0dc47ac63b8400612f78d08a6d8ec6a1a3f /Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
parentde9292f117e507387287c3356ba73da788b13d75 (diff)
parentb9c1f61681de23d95de7c6b392eb3e55670991da (diff)
Merge pull request #3001 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs')
-rw-r--r--Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
index cd7c98dc8..4a9e417f2 100644
--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
@@ -16,6 +16,7 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
+using MediaBrowser.Controller.IO;
namespace Emby.Server.Implementations.HttpClientManager
{
@@ -633,12 +634,9 @@ namespace Emby.Server.Implementations.HttpClientManager
}
else
{
- using (var stream = ProgressStream.CreateReadProgressStream(httpResponse.GetResponseStream(), options.Progress.Report, contentLength.Value))
+ using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
{
- using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
- {
- await stream.CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, options.CancellationToken).ConfigureAwait(false);
- }
+ await StreamHelper.CopyToAsync(httpResponse.GetResponseStream(), fs, StreamDefaults.DefaultCopyToBufferSize, options.Progress, contentLength.Value, options.CancellationToken).ConfigureAwait(false);
}
}