diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-10-03 19:52:38 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-10-03 19:52:38 +0200 |
| commit | 9af16fcb6c892238b734c267873b1fc137d38e66 (patch) | |
| tree | d6a954b0e41c988f55d1500e944c1fe5f2decf04 /MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs | |
| parent | 9718c0b2eeb3ff2c2d0f613bfb51db6a025b0a07 (diff) | |
Remove workaround for dotnet/runtime#42790
Diffstat (limited to 'MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs')
| -rw-r--r-- | MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs index e0b2f9c58..321013b17 100644 --- a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs +++ b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs @@ -154,8 +154,10 @@ namespace MediaBrowser.Providers.Plugins.AudioDb Directory.CreateDirectory(Path.GetDirectoryName(path)); - // use FileShare.None as this bypasses dotnet bug dotnet/runtime#42790 . - await using var xmlFileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous); + var fileStreamOptions = AsyncFile.WriteOptions; + fileStreamOptions.Mode = FileMode.Create; + fileStreamOptions.PreallocationSize = stream.Length; + await using var xmlFileStream = new FileStream(path, fileStreamOptions); await stream.CopyToAsync(xmlFileStream, cancellationToken).ConfigureAwait(false); } |
