Merge pull request #6613 from Bond-009/randomaccess

This commit is contained in:
Claus Vium
2021-09-25 20:34:21 +02:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -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