aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-09-25 20:52:09 +0200
committercvium <clausvium@gmail.com>2021-09-25 20:52:09 +0200
commit30f3be1da0958dc9c129d09de13625b13f33a3a6 (patch)
tree0b61f595e1fe1699c85d87358ccbb75cbde961c0 /Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
parent3e5cb8e04e11d05b4af54e88686e829429305870 (diff)
parent17273a6075e2735642075c6060eb86fc910474a9 (diff)
Merge branch 'master' into keyframe_extraction_v1
Diffstat (limited to 'Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs')
-rw-r--r--Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
index e171fc145..be4926da6 100644
--- a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
+++ b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
@@ -55,8 +55,8 @@ namespace Jellyfin.Server.Infrastructure
// This may or may not be fixed in .NET 6, but looks like it will not https://github.com/dotnet/aspnetcore/issues/34371
if ((fileInfo.Attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint)
{
- using Stream thisFileStream = File.OpenRead(path);
- length = thisFileStream.Length;
+ using var fileHandle = File.OpenHandle(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ length = RandomAccess.GetLength(fileHandle);
}
return new FileMetadata
@@ -68,7 +68,7 @@ namespace Jellyfin.Server.Infrastructure
}
/// <inheritdoc />
- protected override Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue range, long rangeLength)
+ protected override Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength)
{
if (context == null)
{
@@ -132,7 +132,7 @@ namespace Jellyfin.Server.Infrastructure
FileAccess.Read,
FileShare.ReadWrite,
bufferSize: BufferSize,
- options: (AsyncFile.UseAsyncIO ? FileOptions.Asynchronous : FileOptions.None) | FileOptions.SequentialScan);
+ options: FileOptions.Asynchronous | FileOptions.SequentialScan);
fileStream.Seek(offset, SeekOrigin.Begin);
await StreamCopyOperation