mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 21:37:59 +03:00
[PR #16161] fix: Playbackinfo - Return API URLs for local external subtitle files on remote media sources #14544
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/16161
Author: @ashktn
Created: 2/1/2026
Status: 🔄 Open
Base:
master← Head:fix/strm-files-with-local-srt📝 Commits (2)
8daa6f7fix: Return API URLs for local external subtitles on remote media sources0593a50fix: external subtitle delivery for remote media sources📊 Changes
4 files changed (+144 additions, -2 deletions)
View changed files
📝
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs(+11 -1)📝
MediaBrowser.Model/Dlna/StreamInfo.cs(+2 -1)📝
tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs(+29 -0)📝
tests/Jellyfin.Model.Tests/Dlna/StreamInfoTests.cs(+102 -0)📄 Description
fixes #16184
Issue Description
When a client calls the /Items/{itemId}/PlaybackInfo endpoint with a device profile that declares external subtitle support (e.g., SRT), the server incorrectly returns local file system paths for external subtitle files when the media source is remote.
Reproduction Steps
Setup: Add an
strmfile inC:\Jellyfin\video\video.strm, which has a link to an http server pathhttp://server.com/video.mkvSubtitle: External subtitle file stored locally on Jellyfin server's file system
Path:
C:\Jellyfin\video\subtitle.srtAPI Call: Client calls
POST /Items/{id}/PlaybackInfowith device profile:SubtitleProfiles: [
{Format: srt, Method: External},
{Format: subrip, Method: External}
]
Expected Behavior
Server should return API URL for subtitle:
DeliveryUrl: /Videos/{itemId}/{mediaSourceId}/Subtitles/0/0/Stream.subrip?ApiKey={token}
Actual Behavior
Server returns local file path that client cannot access:
DeliveryUrl:
C:\Jellyfin\video\subtitle.srtImpact
Fix
Added check: && MediaSource.Protocol == MediaProtocol.File
This ensures direct subtitle paths are only used when both media and subtitles are local.
Test
Before
After
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.