@@ -883,10 +883,10 @@ sub _renderItem {
883
883
return _renderTrack($item , $args -> {addArtistToTitle }, $args -> {playlistId });
884
884
}
885
885
elsif ($type eq ' album' ) {
886
- return _renderAlbum($item , $args -> {addArtistToTitle });
886
+ return _renderAlbum($item , $args -> {addArtistToTitle }, $args -> { sorted } );
887
887
}
888
888
elsif ($type eq ' artist' ) {
889
- return _renderArtist($client , $item );
889
+ return _renderArtist($client , $item , $args );
890
890
}
891
891
elsif ($type eq ' playlist' ) {
892
892
return _renderPlaylist($item );
@@ -945,7 +945,7 @@ sub _renderAlbums {
945
945
}
946
946
947
947
sub _renderAlbum {
948
- my ($item , $addArtistToTitle ) = @_ ;
948
+ my ($item , $addArtistToTitle , $sorted ) = @_ ;
949
949
950
950
# we could also join names
951
951
my $artist = $item -> {artist } || $item -> {artists }-> [0] || {};
@@ -957,7 +957,7 @@ sub _renderAlbum {
957
957
name => $title ,
958
958
line1 => $item -> {title },
959
959
line2 => $artist -> {name },
960
- textkey => substr ( uc ($item -> {title }), 0, 1 ),
960
+ textkey => $sorted ? substr ( uc ($item -> {title }), 0, 1 ) : undef ,
961
961
favorites_url => ' tidal://album:' . $item -> {id },
962
962
favorites_title => $item -> {title } . ' - ' . $artist -> {name },
963
963
favorites_type => ' playlist' ,
@@ -1041,7 +1041,9 @@ sub _renderArtists {
1041
1041
}
1042
1042
1043
1043
sub _renderArtist {
1044
- my ($client , $item ) = @_ ;
1044
+ my ($client , $item , $args ) = @_ ;
1045
+
1046
+ $args ||= {};
1045
1047
1046
1048
my $items = [{
1047
1049
name => cstring($client , ' PLUGIN_TIDAL_TOP_TRACKS' ),
@@ -1092,7 +1094,7 @@ sub _renderArtist {
1092
1094
return scalar @$items > 1
1093
1095
? {
1094
1096
name => $item -> {name },
1095
- textkey => substr ( uc ($item -> {name }), 0, 1 ),
1097
+ textkey => $args -> { sorted } ? substr ( uc ($item -> {name }), 0, 1 ) : undef ,
1096
1098
type => ' outline' ,
1097
1099
items => $items ,
1098
1100
itemActions => $itemActions ,
0 commit comments