Index: Slim/Schema/ResultSet/Contributor.pm =================================================================== --- Slim/Schema/ResultSet/Contributor.pm (revision 10665) +++ Slim/Schema/ResultSet/Contributor.pm (working copy) @@ -7,6 +7,29 @@ use Slim::Utils::Prefs; +my @albumSortRules = ( + # 0: No special sorting + "concat('0', album.titlesort), album.disc", + + # 1: Sort by year ascending, unset years last + "CASE album.year " . + " WHEN 0 THEN 9999" . + " ELSE album.year " . + "END, concat('0', album.titlesort), album.disc", + + # 2: Sort by year ascending, unset years first + "album.year, concat('0', album.titlesort), album.disc", + + # 3: Sort by year descending, unset years last + "album.year DESC, concat('0', album.titlesort), album.disc", + + # 4: Sort by year ascending, unset years first + "CASE album.year " . + " WHEN 0 THEN 9999" . + " ELSE album.year " . + "END DESC, concat('0', album.titlesort), album.disc" +); + sub pageBarResults { my $self = shift; @@ -112,7 +135,8 @@ } else { - $sort = "concat('0', album.titlesort), album.disc"; + my $sortByYear = Slim::Utils::Prefs::get('sortAlbumsByYear') || 0; + $sort = $albumSortRules[$sortByYear] || $albumSortRules[0]; } my $attr = { Index: Slim/Utils/Prefs.pm =================================================================== --- Slim/Utils/Prefs.pm (revision 10665) +++ Slim/Utils/Prefs.pm (working copy) @@ -171,6 +171,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/Settings/Server/TextFormatting.pm =================================================================== --- Slim/Web/Settings/Server/TextFormatting.pm (revision 10665) +++ Slim/Web/Settings/Server/TextFormatting.pm (working copy) @@ -30,6 +30,7 @@ timeFormat showArtist showYear + sortAlbumsByYear ); # If this is a settings update Index: HTML/EN/settings/server/formatting.html =================================================================== --- HTML/EN/settings/server/formatting.html (revision 10665) +++ HTML/EN/settings/server/formatting.html (working copy) @@ -61,6 +61,19 @@ +
[% "SETUP_SORTALBUMSBYYEAR" | string | upper %]
+
[% "SETUP_SORTALBUMSBYYEAR_DESC" | string %]
+ + +
Index: strings.txt =================================================================== --- strings.txt (revision 10665) +++ strings.txt (working copy) @@ -3934,6 +3934,21 @@ NL Je kunt kiezen om het jaar te laten zien bij bekijken op albums of hoesafbeeldingen. 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_SORTALBUMSBYYEAR_1 + EN Sort by year ascending, unset years last +SETUP_SORTALBUMSBYYEAR_2 + EN Sort by year ascending, unset years first +SETUP_SORTALBUMSBYYEAR_3 + EN Sort by year descending, unset years last +SETUP_SORTALBUMSBYYEAR_4 + EN Sort by year descending, unset years first + SETUP_SHOWARTIST DE Interpreten beim Durchsuchen der Alben anzeigen EN Show Artist with Albums