feat(JellyfinApiSource): add option to override the Jellyfin base url#374
Conversation
… used in the frontend
There was a problem hiding this comment.
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
frontendUrlOverrideconfiguration field to JellyApiData interface - Implemented URL replacement logic in
formatPlayObjAwaremethod 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.
|
Thanks for the contribution! LGTM. |
|
is there a way to configure this via environment variables? I assumed it'd correspond to |
|
@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 |
|
@againstpetra I've added |
|
Amazng, thanks @FoxxMD! |
Checklist before requesting a review
Type of change
Please delete options that are not relevant.
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:
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:
frontendUrlOverrideis not set then it doesn't change the URLsfrontendUrlOverrideis set then it updates the URLs correctlyreplaceUrlIfNeededcorrectly replaces the first instance of the override URL when applicableIssue number and link, if applicable
N/a