LMS-Community / slimserver

Server for Squeezebox and compatible players. This server is also called Lyrion Music Server.
https://lyrion.org
Other
1.18k stars 294 forks source link

Station logo doesn't show on "Now Playing" when Favorites URL is not canonical. #951

Open bpa-code opened 10 months ago

bpa-code commented 10 months ago

If the remote URL of a station in a favorite is not canonical, the station logo is cached ("remoteimage$url") using the URL in the Favorite but the URL supplied to "getMetadataFor" will be a canonical URL and so station logo is not found.

The issue came up with the following favorite entry.

The above will not show station logo when playing but if the Favorite is changed to add a trailing "/" - the logo will be displayed.

The URL https://stream.radio357.pl is a root URL but is not canonical without a trailing "/". The URL was supplied by a RadioNet.

LMS in Schema.pm objectForUrl - will make an URL canonical before adding to database and this is the URL used when playing the Favorite.

A possible solution would be to add the following lines to Remote.pm setRemoteMetadata if ( $url =~ /^http/i ) { $url = URI->new($url)->canonical->as_string; }

I'm not sure if it'll break something.

The alternative is to tell users to ensure URLs are canonical but I feel saving data with one URL and then trying to retrieve with changed URL is not right.

michaelherger commented 10 months ago

Could you please provide a patch which we could test?