Skip to content

feat(JellyfinApiSource): add option to override the Jellyfin base url#374

Merged
FoxxMD merged 2 commits intoFoxxMD:masterfrom
wolffshots:feature/optionally-redirect-image-paths
Oct 24, 2025
Merged

feat(JellyfinApiSource): add option to override the Jellyfin base url#374
FoxxMD merged 2 commits intoFoxxMD:masterfrom
wolffshots:feature/optionally-redirect-image-paths

Conversation

@wolffshots
Copy link
Copy Markdown
Contributor

@wolffshots wolffshots commented Oct 23, 2025

Checklist before requesting a review

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Describe your changes

Context

I have multi-scrobbler set up on the same network as my Jellyfin so have set up the API source to use the local IP of Jellyfin (so that it's robust enough if I lose internet access) but when I access the web frontend for multi-scrobbler through my reverse proxy with HTTPS that means that the images for album covers are not shown for 2 reasons:

  1. when not on the same network - because the browser is trying to access the IP local to the multi-scrobbler process
  2. when on the same network - because the request for HTTP content is blocked because the frontend is served via HTTPS

Changes

This PR adds a variable to the JellyfinApiSource configuration called frontendUrlOverride (maybe not a perfect name so open to suggestions) which is then used when generating the links for the album art (for the now playing area) and direct Jellyfin album links (for the "Tracks Discovered"/"Recently Played" area)

I also added tests which assert that:

  • if frontendUrlOverride is not set then it doesn't change the URLs
  • if frontendUrlOverride is set then it updates the URLs correctly
  • some tests to ensure that replaceUrlIfNeeded correctly replaces the first instance of the override URL when applicable

Issue number and link, if applicable

N/a

Copilot AI review requested due to automatic review settings October 23, 2025 15:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a frontendUrlOverride configuration option to the JellyfinApiSource that allows users to specify an alternative base URL for frontend requests. This solves issues when multi-scrobbler is accessed through a reverse proxy with HTTPS, ensuring album art and links work correctly both on and off the local network.

Key Changes:

  • Added frontendUrlOverride configuration field to JellyApiData interface
  • Implemented URL replacement logic in formatPlayObjAware method for album art and web URLs
  • Added comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/backend/common/infrastructure/config/source/jellyfin.ts Added frontendUrlOverride optional field to JellyApiData interface with documentation
src/backend/sources/JellyfinApiSource.ts Implemented URL replacement logic that substitutes the configured URL with frontendUrlOverride when set
src/backend/tests/jellyfin/jellyfin.test.ts Added test suite verifying URL handling with and without frontendUrlOverride configured

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/backend/sources/JellyfinApiSource.ts Outdated
Comment thread src/backend/sources/JellyfinApiSource.ts Outdated
Comment thread src/backend/sources/JellyfinApiSource.ts Outdated
@FoxxMD
Copy link
Copy Markdown
Owner

FoxxMD commented Oct 24, 2025

Thanks for the contribution! LGTM.

@FoxxMD FoxxMD merged commit cac8163 into FoxxMD:master Oct 24, 2025
5 checks passed
@wolffshots wolffshots deleted the feature/optionally-redirect-image-paths branch October 24, 2025 15:39
@againstpetra
Copy link
Copy Markdown

is there a way to configure this via environment variables? I assumed it'd correspond to JELLYFIN_FRONTEND_URL_OVERRIDE but that doesn't seem to work

@wolffshots
Copy link
Copy Markdown
Contributor Author

@againstpetra, sorry I didn't think to make sure it worked as a env variable. Will open a new PR with that if I get around to it

@FoxxMD
Copy link
Copy Markdown
Owner

FoxxMD commented Oct 30, 2025

@againstpetra I've added JELLYFIN_FRONTEND_URL_OVERRIDE as an env. It's available in the master branch or edge docker tag.

@wolffshots
Copy link
Copy Markdown
Contributor Author

Amazng, thanks @FoxxMD!

@FoxxMD FoxxMD mentioned this pull request Mar 11, 2026
4 tasks
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.

4 participants