nicknsy / jellyscrub

Smooth mouse-over video scrubbing previews for Jellyfin.
MIT License
670 stars 27 forks source link

Networking - Subpath/Base URL is not taken into account #14

Closed owdevel closed 2 years ago

owdevel commented 2 years ago

The Base URL setting in Jellyfin's Advanced Networking tab is not taken into account for any of the redirects or requests. This leads to the requests on the /Trickplay endpoint to not be handled correctly.

Example: Deployed via Docker: linuxserver/jellyfin:10.8.3 with a modified init script to chown /usr/share/jellyfin/web for injection Base URL: /jellyfin-test

API endpoint is accessible at 192.168.100.12:8097/jellyfin-test/Trickplay/ClientScript as seen in the image below

image

However the injection code doesn't take this into account and it would seem the javascript doesn't take this into account either. Debugging shows the request URL not containing the base url which results in a 302/404 depending on reverse proxy configuration.

image

One possible solution would be to ensure that the Base URL variable is taken into account in all URL injections and scripts. I may be able to do a PR to fix this issue but am quite busy at the moment and I'm unfamiliar with the ecosystem so it might take a while. I'm not an expert at networking however so there may be other, simpler solutions.

A temporary solution if using a reverse proxy is to redirect /Trickplay to /{basepath}/Trickplay. I'll include my Caddyv2 handle as an example:

handle /Trickplay* {
  redir {url}/jellyfin-test{uri}
}

So far in my testing with the workaround enabled I haven't had any troubles and it has been working fairly well otherwise.