mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-03 22:40:09 +00:00
Use RandomAccess instead of a FileStream where it makes sense
This commit is contained in:
parent
2ee3e9e00f
commit
a4eede29ab
2 changed files with 4 additions and 4 deletions
|
|
@ -246,9 +246,9 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
try
|
||||
{
|
||||
using (Stream thisFileStream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read, FileShare.Read, 1))
|
||||
using (var fileHandle = File.OpenHandle(fileInfo.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||
{
|
||||
result.Length = thisFileStream.Length;
|
||||
result.Length = RandomAccess.GetLength(fileHandle);
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue