aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/ItemLookupController.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2021-03-07 19:37:21 -0500
committerJoshua M. Boniface <joshua@boniface.me>2021-03-08 18:08:25 -0500
commita10eea41ac76913cd1d7535938dd5af2b51b467f (patch)
tree1c5b3c16b12791853d4a419c2ad979420d2d9549 /Jellyfin.Api/Controllers/ItemLookupController.cs
parent42d0c1ac5fe56a5c0185197200d1efa63d6f78b9 (diff)
Merge pull request #5402 from Ullmie02/fix-null-size
Use FileShare.None when creating files (cherry picked from commit 480dd66428e2a8bf76c0747256f2e99b15aae212) Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemLookupController.cs')
-rw-r--r--Jellyfin.Api/Controllers/ItemLookupController.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/ItemLookupController.cs b/Jellyfin.Api/Controllers/ItemLookupController.cs
index 6c38f77ce..9f81f91c1 100644
--- a/Jellyfin.Api/Controllers/ItemLookupController.cs
+++ b/Jellyfin.Api/Controllers/ItemLookupController.cs
@@ -346,11 +346,12 @@ namespace Jellyfin.Api.Controllers
Directory.CreateDirectory(directory);
using (var stream = result.Content)
{
+ // use FileShare.None as this bypasses dotnet bug dotnet/runtime#42790 .
await using var fileStream = new FileStream(
fullCachePath,
FileMode.Create,
FileAccess.Write,
- FileShare.Read,
+ FileShare.None,
IODefaults.FileStreamBufferSize,
true);