Merge pull request #3585 from Ken-g6/2354-soft-link-sizes

2354 fix soft link sizes
pull/3595/head
Bond-009 4 years ago committed by GitHub
commit ce07e45897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -245,6 +245,16 @@ namespace Emby.Server.Implementations.IO
if (info is FileInfo fileInfo)
{
result.Length = fileInfo.Length;
// Issue #2354 get the size of files behind symbolic links
if (fileInfo.Attributes.HasFlag(FileAttributes.ReparsePoint))
{
using (Stream thisFileStream = File.OpenRead(fileInfo.FullName))
{
result.Length = thisFileStream.Length;
}
}
result.DirectoryName = fileInfo.DirectoryName;
}

Loading…
Cancel
Save