Use CryptoStream to convert stream from base64

Should be way more efficient
This commit is contained in:
Bond_009
2023-10-05 23:29:31 +02:00
parent 40f7eb4e8c
commit efc4c305a9
3 changed files with 28 additions and 29 deletions

View File

@@ -263,7 +263,11 @@ namespace MediaBrowser.Providers.Manager
var fileStreamOptions = AsyncFile.WriteOptions;
fileStreamOptions.Mode = FileMode.Create;
fileStreamOptions.PreallocationSize = source.Length;
if (source.CanSeek)
{
fileStreamOptions.PreallocationSize = source.Length;
}
var fs = new FileStream(path, fileStreamOptions);
await using (fs.ConfigureAwait(false))
{