aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Brazier <kbrazier@gmail.com>2020-05-31 16:40:02 -0600
committerKen Brazier <kbrazier@gmail.com>2020-05-31 16:40:02 -0600
commit36312c92f56671484caaeaf89e28f7737723e97d (patch)
treeb60fff0f6eba087a1808158f5da0c567b2a47d02
parentb89565110d320756e46f2d157c06ab806c3b1756 (diff)
2354 open soft-links to read size
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index 7461ec4f1..8b75e8c70 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -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.ToString()))
+ {
+ result.Length = thisFileStream.Length;
+ }
+ }
+
result.DirectoryName = fileInfo.DirectoryName;
}