Index: Slim/Schema/ResultSet/Contributor.pm =================================================================== --- Slim/Schema/ResultSet/Contributor.pm (revision 8752) +++ Slim/Schema/ResultSet/Contributor.pm (working copy) @@ -96,8 +96,26 @@ # Create a clean resultset my $rs = $self->result_source->resultset; - my $attr = { + my $attr; + + if (my $sortByYear = Slim::Utils::Prefs::get('sortAlbumsByYear')) { + $attr = { + # Sort by year + # 'order_by' => "album.year, concat('0', album.titlesort), album.disc", + + # Sort by year, with un-yeared albums at the end + 'order_by' => "CASE album.year " . + " WHEN 0 THEN 9999" . + " ELSE album.year " . + "END, concat('0', album.titlesort), album.disc", + }; + } + else + { + $attr = { 'order_by' => "concat('0', album.titlesort), album.disc", + }; + }; if (my $roles = Slim::Schema->artistOnlyRoles) { Index: Slim/Utils/Prefs.pm =================================================================== --- Slim/Utils/Prefs.pm (revision 8752) +++ Slim/Utils/Prefs.pm (working copy) @@ -167,6 +167,7 @@ 'longdateFormat' => q(%A, %B |%d, %Y), 'shortdateFormat' => q(%m/%d/%Y), 'showYear' => 0, + 'sortAlbumsByYear' => 0, 'timeFormat' => q(|%I:%M:%S %p), 'titleFormatWeb' => 1, 'ignoreDirRE' => '', Index: Slim/Web/Setup.pm =================================================================== --- Slim/Web/Setup.pm (revision 8752) +++ Slim/Web/Setup.pm (working copy) @@ -1787,7 +1787,7 @@ ,'GroupOrder' => ['Default','TitleFormats','GuessFileFormats'] ,'Groups' => { 'Default' => { - 'PrefOrder' => ['longdateFormat','shortdateFormat','timeFormat','showArtist','showYear'] + 'PrefOrder' => ['longdateFormat','shortdateFormat','timeFormat','showArtist','showYear', 'sortAlbumsByYear'] } ,'TitleFormats' => { 'PrefOrder' => ['titleFormat'] @@ -1859,6 +1859,13 @@ '1' => 'ENABLED' } } + ,'sortAlbumsByYear' => { + 'validate' => \&Slim::Utils::Validate::trueFalse + ,'options' => { + '0' => 'DISABLED', + '1' => 'ENABLED' + } + } ,'guessFileFormats' => { 'isArray' => 1 ,'arrayAddExtra' => 1 Index: strings.txt =================================================================== --- strings.txt (revision 8752) +++ strings.txt (working copy) @@ -3625,6 +3625,12 @@ NL Je kunt kiezen om het jaar te laten zien bij "Bekijk op album". Indien actief zal het jaar getoond worden naast de albumtitel. ZH_CN 您可以选择通过浏览乐谱帖或浏览乐谱帖图象时是否一同显示乐谱帖的年份。当您选择一同显示时,年份信息将显示在乐谱帖标题旁边。 +SETUP_SORTALBUMSBYYEAR + EN Sort Albums in Artist lists by year + +SETUP_SORTALBUMSBYYEAR_DESC + EN You may choose to sort the albums by year when displayed within the artists list. When enabled, the Albums listed from an Artist menu will be sorted by the year associated with that album with albums without years listed last. When disabled, the Albums listed from an Artist menu will be sorted alphabetic order. + SETUP_SHOWARTIST DE Interpreten beim Durchsuchen der Alben anzeigen EN Show Artist with Albums