Skip to content

Commit 167b7f3

Browse files
committed
v1.5.1 - only provide textkeys in sorted lists
1 parent f645047 commit 167b7f3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Plugin.pm

+8-6
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,10 @@ sub _renderItem {
883883
return _renderTrack($item, $args->{addArtistToTitle}, $args->{playlistId});
884884
}
885885
elsif ($type eq 'album') {
886-
return _renderAlbum($item, $args->{addArtistToTitle});
886+
return _renderAlbum($item, $args->{addArtistToTitle}, $args->{sorted});
887887
}
888888
elsif ($type eq 'artist') {
889-
return _renderArtist($client, $item);
889+
return _renderArtist($client, $item, $args);
890890
}
891891
elsif ($type eq 'playlist') {
892892
return _renderPlaylist($item);
@@ -945,7 +945,7 @@ sub _renderAlbums {
945945
}
946946

947947
sub _renderAlbum {
948-
my ($item, $addArtistToTitle) = @_;
948+
my ($item, $addArtistToTitle, $sorted) = @_;
949949

950950
# we could also join names
951951
my $artist = $item->{artist} || $item->{artists}->[0] || {};
@@ -957,7 +957,7 @@ sub _renderAlbum {
957957
name => $title,
958958
line1 => $item->{title},
959959
line2 => $artist->{name},
960-
textkey => substr( uc($item->{title}), 0, 1 ),
960+
textkey => $sorted ? substr( uc($item->{title}), 0, 1 ) : undef,
961961
favorites_url => 'tidal://album:' . $item->{id},
962962
favorites_title => $item->{title} . ' - ' . $artist->{name},
963963
favorites_type => 'playlist',
@@ -1041,7 +1041,9 @@ sub _renderArtists {
10411041
}
10421042

10431043
sub _renderArtist {
1044-
my ($client, $item) = @_;
1044+
my ($client, $item, $args) = @_;
1045+
1046+
$args ||= {};
10451047

10461048
my $items = [{
10471049
name => cstring($client, 'PLUGIN_TIDAL_TOP_TRACKS'),
@@ -1092,7 +1094,7 @@ sub _renderArtist {
10921094
return scalar @$items > 1
10931095
? {
10941096
name => $item->{name},
1095-
textkey => substr( uc($item->{name}), 0, 1 ),
1097+
textkey => $args->{sorted} ? substr( uc($item->{name}), 0, 1 ) : undef,
10961098
type => 'outline',
10971099
items => $items,
10981100
itemActions => $itemActions,

install.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<description>PLUGIN_TIDAL_DESC</description>
55
<creator>philippe_44, Michael Herger</creator>
66
<id>16da8158-263f-4347-8125-184372ea5610</id>
7-
<version>1.5.0</version>
7+
<version>1.5.1</version>
88
<module>Plugins::TIDAL::Plugin</module>
99
<importmodule>Plugins::TIDAL::Importer</importmodule>
1010
<optionsURL>plugins/TIDAL/settings.html</optionsURL>

0 commit comments

Comments
 (0)