aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LibraryController.cs
diff options
context:
space:
mode:
authorTim Eisele <Ghost_of_Stone@web.de>2026-06-01 19:43:25 +0200
committerGitHub <noreply@github.com>2026-06-01 19:43:25 +0200
commitc7111b7570895cd999b8ca6abde9f8d558b99200 (patch)
tree6536ac48ccb683a9a2f77b7b218a717cdd7b5957 /Jellyfin.Api/Controllers/LibraryController.cs
parent8b387c82cf8011c0df0efb56ee7aaa97063ee869 (diff)
Only resolve symlinks on playback (#16965)
Only resolve symlinks on playback
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LibraryController.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index 6a30a80f1d..39a6fbace8 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -119,7 +119,18 @@ public class LibraryController : BaseJellyfinApiController
return NotFound();
}
- return PhysicalFile(item.Path, MimeTypes.GetMimeType(item.Path), true);
+ var filePath = item.Path;
+ if (item.IsFileProtocol)
+ {
+ // PhysicalFile does not work well with symlinks at the moment.
+ var resolved = FileSystemHelper.ResolveLinkTarget(filePath, returnFinalTarget: true);
+ if (resolved is not null && resolved.Exists)
+ {
+ filePath = resolved.FullName;
+ }
+ }
+
+ return PhysicalFile(filePath, MimeTypes.GetMimeType(filePath), true);
}
/// <summary>