Skip to content

Properly fetch subtitles from Jellyfin with a base URL configured#833

Merged
killergerbah merged 2 commits intokillergerbah:mainfrom
Hawkheart:jf
Dec 6, 2025
Merged

Properly fetch subtitles from Jellyfin with a base URL configured#833
killergerbah merged 2 commits intokillergerbah:mainfrom
Hawkheart:jf

Conversation

@Hawkheart
Copy link
Copy Markdown
Contributor

Instead of assuming that the Jellyfin server is running on /, use the API path from the API client we're hooking as a base.

fixes #586

const extension = 'srt';
var url =
window.location.origin +
ApiClient._serverAddress +
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this still fallback to the window.location.origin ? I'm worried that ApiClient._serverAddress could change as the field is prefixed by an underscore which usually indicates its a "private" field?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the lead of the code a bit above which fetches the device ID in a similar way.

It seems like current versions of both Jellyfin and Emby expose both through "public" getter functions (ApiClient.deviceId() and ApiClient.serverAddress()) that are probably cleaner to use with less risk of changes.

@killergerbah killergerbah merged commit b673e08 into killergerbah:main Dec 6, 2025
1 check passed
@killergerbah
Copy link
Copy Markdown
Owner

Thanks!

@killergerbah killergerbah added this to the Extension v1.14.0 milestone Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jellyfin internal subtitles are not detected when using Jellyfin on a base path different than /

2 participants