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.
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.