[PR #6541] [MERGED] Read file length for symlinks, #11015

Closed
opened 2026-02-07 06:30:53 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/6541
Author: @cvium
Created: 9/11/2021
Status: Merged
Merged: 9/20/2021
Merged by: @Bond-009

Base: masterHead: symlink_workaround


📝 Commits (8)

📊 Changes

2 files changed (+151 additions, -0 deletions)

View changed files

Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs (+145 -0)
📝 Jellyfin.Server/Startup.cs (+6 -0)

📄 Description

Changes
Created a subclass of PhysicalFileResultExecutor and replaced it in the DI container. It unfortunately reads the file attributes 1-2 times more than its superclass, but FileInfo is called multiple times even outside PhysicalFileResultExecutor. Therefore I have copied parts of static extensions methods eg. https://github.com/dotnet/aspnetcore/blob/main/src/Http/Http/src/SendFileFallback.cs to get the desired result.

The new executor is only used for symlinks.

Supersedes #5775 and #5824. And a huge thanks for the research done by both PR authors.

Issues
Fixes https://github.com/jellyfin/jellyfin/issues/5521


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/6541 **Author:** [@cvium](https://github.com/cvium) **Created:** 9/11/2021 **Status:** ✅ Merged **Merged:** 9/20/2021 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `symlink_workaround` --- ### 📝 Commits (8) - [`6a2df35`](https://github.com/jellyfin/jellyfin/commit/6a2df35b37dbae830508b9291247b3c1ca514c4d) Read file length for symlinks, supersedes #5775 and #5824 - [`30152c8`](https://github.com/jellyfin/jellyfin/commit/30152c8d967500f867feed521ed9f6539f8b0712) Include the MIT license - [`3bc9f38`](https://github.com/jellyfin/jellyfin/commit/3bc9f388339bd1266a6a31e93dac81817da1b312) Fix SA1614 and SA1116 - [`794b73c`](https://github.com/jellyfin/jellyfin/commit/794b73c62d7f9e5a962dc6031e7772c1a644aae9) Use File.GetAttributes instead of creating a new FileInfo - [`e34aa22`](https://github.com/jellyfin/jellyfin/commit/e34aa22dc10188e32ad29e9b29a77d46473f9932) Remove AsyncFile.OpenRead - [`6b8b7f1`](https://github.com/jellyfin/jellyfin/commit/6b8b7f1426a510ce3f0d40d40f3ceb59ccc03934) Update Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs - [`cec0dd9`](https://github.com/jellyfin/jellyfin/commit/cec0dd94baac67852898cc129fc02ceca364b98c) Update Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs - [`62113c4`](https://github.com/jellyfin/jellyfin/commit/62113c46034458d192804fb30708ed9ca414e131) Update Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs ### 📊 Changes **2 files changed** (+151 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs` (+145 -0) 📝 `Jellyfin.Server/Startup.cs` (+6 -0) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** Created a subclass of `PhysicalFileResultExecutor` and replaced it in the DI container. It unfortunately reads the file attributes 1-2 times more than its superclass, but `FileInfo` is called multiple times even outside `PhysicalFileResultExecutor`. Therefore I have copied parts of static extensions methods eg. https://github.com/dotnet/aspnetcore/blob/main/src/Http/Http/src/SendFileFallback.cs to get the desired result. The new executor is only used for symlinks. Supersedes #5775 and #5824. And a huge thanks for the research done by both PR authors. **Issues** Fixes https://github.com/jellyfin/jellyfin/issues/5521 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:30:53 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#11015