slimserver
slimserver copied to clipboard
Sort "All Songs" view alphabetically
I want to sort the tracks in the "All Songs" view alphabetically.
To achieve this I already tried to edit Slim/Menu/BrowseLibrary.pm at line 1638 and removed sort, set it to undef, created an own sort in the Queries.pm But I've realized that this passthrough is never used (same with the url callback, tried to call an own function for alltracks there), all the passthrough options set there are not part of the link generated.
Which "All Songs" menu?
If you choose Artist or Album Artists, then all albums of this artist are displayed. At the end there is a "All Songs" selection. The menu that is than opened should be sorted alphabetically.
I made some more tests. It seems everything but name and icon is ignored in _albums in the $extra variable.
What did you try? You'd have to change the sort:albumtrack parameter to sort:title. And you'd have to do this in all places where the All Songs item is added. Please check the CLI documentation.
Changing the sort:albumtrack was the first thing I've tried in sub _albums.
After this didn't worked I began to try to figur out why. Now I found that nearly nothing of those parameters seems to be used for rendering the following menu/generating the link.
$extra = [ { name => cstring($client, 'ALL_SONGS'), icon => 'html/images/albums.png', type => 'playlist', playlist => \&_tracks, url => \&_tracks, passthrough => [{ searchTags => \@searchTags, sort => 'sort:title', menuStyle => 'menuStyle:allSongs' }], itemActions => \%actions, } ];
I've made a test and changed them to non usefull values. The only things which had an effect was name (All Songs was renamed, also after clicking the link), and icon (no icon was displayed).
Changing the other variables hadn't an effect after all, nothing broke, nothing changed.