diff --git a/Changelog8.html b/Changelog8.html
index 9c838965f6..e7e395ad02 100644
--- a/Changelog8.html
+++ b/Changelog8.html
@@ -23,6 +23,7 @@
Version 8.5.1
Bug Fixes:
+ - Fix definition of track-level favorites' artwork.
diff --git a/HTML/Default/xmlbrowser.html b/HTML/Default/xmlbrowser.html
index 10178e5b72..15f74b98bb 100644
--- a/HTML/Default/xmlbrowser.html
+++ b/HTML/Default/xmlbrowser.html
@@ -164,12 +164,13 @@
[% END %]
[% END %]
+
+
+
[% IF item.favorites == 1 %]
[% WRAPPER favaddlink noTarget=1 %]
- [% IF item.type == 'audio' && item.url %]
- onclick="SqueezeJS.Utils.toggleFavorite(this, '[% item.url | uri | replace("'", "%27") %]', '[% (item.name _ " " _ stringBY _ " " _ item.artist) | uri | replace("'", "%27") %]');"
- [% ELSIF songinfo.favorites %]
- onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.values.-1 | html %]');"
+ [% IF songinfo.favorites && item.type != 'audio' %]
+ onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.name | html | replace("'", "%27") %]');"
[% ELSIF item.simpleAlbumLink && item.favorites_url %]
onclick="SqueezeJS.Utils.toggleFavorite(this, '[% item.favorites_url | uri | replace("'", "%27") %]', '[% (item.name _ " " _ stringBY _ " " _ item.artist) | uri | replace("'", "%27") %]');"
[% ELSE %]
@@ -178,10 +179,8 @@
[% END %]
[% ELSIF item.favorites == 2 %]
[% WRAPPER favdellink noTarget=1 %]
- [% IF item.type == 'audio' && item.url %]
- onclick="SqueezeJS.Utils.toggleFavorite(this, '[% item.url | uri | replace("'", "%27") %]', '[% (item.name _ " " _ stringBY _ " " _ item.artist) | uri | replace("'", "%27") %]');"
- [% ELSIF songinfo.favorites %]
- onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.values.-1 | html %]');"
+ [% IF songinfo.favorites && item.type != 'audio' %]
+ onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.name | html | replace("'", "%27") %]');"
[% ELSE %]
onclick="Browse.XMLBrowser.toggleFavorite(this, '[% (item.index || index _ (start + loop.index)) | uri | replace("'", "%27") %]', '[% pageinfo.startitem %]', '[% sess %]');"
[% END %]
@@ -210,11 +209,11 @@
[%- BLOCK allcontrol -%]
[% IF songinfo.favorites == 1 %]
[% WRAPPER favaddlink noTarget=1 %]
- onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.name | html %]');"
+ onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.name | html | replace("'", "%27") %]');"
[% END %]
[% ELSIF songinfo.favorites == 2 %]
[% WRAPPER favdellink noTarget=1 %]
- onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.name | html %]');"
+ onclick="SqueezeJS.Utils.toggleFavorite(this, '[% songinfo.favorites_url | uri | replace("'", "%27") %]', '[% crumb.name | html | replace("'", "%27") %]');"
[% END %]
[% END %]
diff --git a/Slim/Web/XMLBrowser.pm b/Slim/Web/XMLBrowser.pm
index 55943009cc..3028bff850 100644
--- a/Slim/Web/XMLBrowser.pm
+++ b/Slim/Web/XMLBrowser.pm
@@ -540,7 +540,7 @@ sub handleFeed {
&& !($subFeed->{type} && $subFeed->{type} eq 'search')
&& !(ref $subFeed->{'url'}) )
) {
- $subFeed->{'image'} ||= $subFeed->{'cover'} || $subFeed->{'icon'} || Slim::Player::ProtocolHandlers->iconForURL($subFeed->{'play'} || $subFeed->{'url'});
+ $subFeed->{'image'} ||= $subFeed->{'cover'} || $subFeed->{'icon'} || Slim::Player::ProtocolHandlers->iconForURL($subFeed->{'play'} || $subFeed->{'url'}, $client);
$subFeed->{'image'} = proxiedImage($subFeed->{'image'});
$stash->{'streaminfo'} = {
@@ -999,9 +999,9 @@ sub handleFeed {
my $type = $item->{'favorites_type'} || $item->{'type'} || 'link';
my $name = $item->{'favorites_title'} || $item->{'name'};
- my $icon = $item->{'favorites_icon'} || $item->{'image'} || $item->{'icon'} || Slim::Player::ProtocolHandlers->iconForURL($furl);
+ my $icon = $item->{'favorites_icon'} || $item->{'image'} || $item->{'icon'} || Slim::Player::ProtocolHandlers->iconForURL($furl, $client);
- if ( ($item->{'play'} && !$item->{'favorites_type'})
+ if ( ($item->{'play'} && !$item->{'favorites_type'})
|| ($type eq 'playlist' && $furl =~ /^(file|db):/)
) {
$type = 'audio';