|
|
@ -467,6 +467,8 @@ namespace MediaBrowser.Server.Implementations.Providers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
using (dataToSave)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// If the file already exists but is hidden, the below save will throw an UnauthorizedAccessException
|
|
|
|
// If the file already exists but is hidden, the below save will throw an UnauthorizedAccessException
|
|
|
|
var existingFileInfo = new FileInfo(path);
|
|
|
|
var existingFileInfo = new FileInfo(path);
|
|
|
@ -477,8 +479,6 @@ namespace MediaBrowser.Server.Implementations.Providers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous))
|
|
|
|
using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous))
|
|
|
|
{
|
|
|
|
|
|
|
|
using (dataToSave)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await dataToSave.CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, cancellationToken).ConfigureAwait(false);
|
|
|
|
await dataToSave.CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, cancellationToken).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|