Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction to Album listing (Default Skin) Track favourites link #1007

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions HTML/Default/xmlbrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@

[% IF item.favorites == 1 %]
[% WRAPPER favaddlink noTarget=1 %]
[% IF songinfo.favorites %]
[% IF item.type == 'audio' && item.favorites_url %]
onclick="SqueezeJS.Utils.toggleFavorite(this, '[% item.favorites_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 %]');"
[% 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") %]');"
Expand All @@ -176,7 +178,9 @@
[% END %]
[% ELSIF item.favorites == 2 %]
[% WRAPPER favdellink noTarget=1 %]
[% IF songinfo.favorites %]
[% IF item.type == 'audio' && item.favorites_url %]
onclick="SqueezeJS.Utils.toggleFavorite(this, '[% item.favorites_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 %]');"
[% ELSE %]
onclick="Browse.XMLBrowser.toggleFavorite(this, '[% (item.index || index _ (start + loop.index)) | uri | replace("'", "%27") %]', '[% pageinfo.startitem %]', '[% sess %]');"
Expand Down
2 changes: 2 additions & 0 deletions Slim/Menu/BrowseLibrary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,8 @@ sub _tracks {
delete $_->{'artwork_track_id'};
$_->{'playall'} = 1;
}

$_->{'favorites_url'} = $_->{'url'};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the item.url in the template? Would save one more line change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I added that before full investigation, just in case its existence solved the problem. I'll remove it.

}

my $params = _tagsToParams(\@searchTags);
Expand Down