Index: Slim/Utils/Prefs.pm =================================================================== --- Slim/Utils/Prefs.pm (revision 2198) +++ Slim/Utils/Prefs.pm (working copy) @@ -209,6 +209,10 @@ ,'dbsource' => 'dbi:SQLite:dbname=%s' ,'dbusername' => '' ,'dbpassword' => '' + ,'commonAlbumTitles' => ['Greatest Hits', + 'Best of...', + 'Live' + ] ); # The following hash contains functions that are executed when the pref corresponding to Index: Slim/DataStores/DBI/DBIStore.pm =================================================================== --- Slim/DataStores/DBI/DBIStore.pm (revision 2198) +++ Slim/DataStores/DBI/DBIStore.pm (working copy) @@ -1106,7 +1106,7 @@ } elsif ($create && $album) { - my $sortable_title = $attributes->{'ALBUMSORT'} || $album; + my $sortable_title = Slim::Utils::Text::ignoreCaseArticles($attributes->{'ALBUMSORT'} || $album); my $disc = $attributes->{'DISC'}; my $discc = $attributes->{'DISCC'}; @@ -1130,11 +1130,17 @@ } else { - if ($contributors[0]) { - + my @common_albums = Slim::Utils::Prefs::getArray('commonAlbumTitles'); + if ((grep $album =~ m/^$_$/i, @common_albums) && + $contributors[0]) { ($albumObj) = Slim::DataStores::DBI::Album->search({ - title => $album, + titlesort => $sortable_title, contributors => $contributors[0]->id, + }); + } + else { + ($albumObj) = Slim::DataStores::DBI::Album->search({ + titlesort => $sortable_title, }); } @@ -1163,7 +1169,7 @@ $albumObj->contributors($contributors[0]->id); # Always normalize the sort, as ALBUMSORT could come from a TSOA tag. - $albumObj->titlesort(Slim::Utils::Text::ignoreCaseArticles($sortable_title)) if $sortable_title; + $albumObj->titlesort($sortable_title) if $sortable_title; $albumObj->disc($disc) if $disc; $albumObj->discc($discc) if $discc; Index: Slim/Web/Setup.pm =================================================================== --- Slim/Web/Setup.pm (revision 2198) +++ Slim/Web/Setup.pm (working copy) @@ -1511,7 +1511,7 @@ 'PrefOrder' => ['displaytexttimeout', ,'playtrackalbum','searchSubString', 'ignoredarticles','splitList','filesort','browseagelimit' ,'groupdiscs','persistPlaylists','reshuffleOnRepeat','saveShuffled', - ,'checkVersion'] + ,'commonAlbumTitles' ,'checkVersion'] } } ,'Prefs' => { @@ -1591,6 +1591,23 @@ ,'0' => string ('SETUP_GROUPDISCS_0') } } + ,'commonAlbumTitles' => { + 'isArray' => 1 + ,'arrayAddExtra' => 1 + ,'arrayDeleteNull' => 1 + ,'arrayDeleteValue' => '' + ,'arrayBasicValue' => 0 + ,'PrefSize' => 'large' + ,'inputTemplate' => 'setup_input_array_txt.html' + ,'onChange' => sub { + my ($client,$changeref,$paramref,$pageref) = @_; + if (exists($changeref->{'commonAlbumTitles'}{'Processed'})) { + return; + } + processArrayChange($client,'commonAlbumTitles',$paramref,$pageref); + $changeref->{'commonAlbumTitles'}{'Processed'} = 1; + } + } } } #end of setup{'behavior'} hash ,'formatting' => { Index: strings.txt =================================================================== --- strings.txt (revision 2198) +++ strings.txt (working copy) @@ -3779,6 +3779,12 @@ PT Não Manter Playlists SE Behåll inte låtlistor +SETUP_COMMONALBUMTITLES + EN Common Album Titles + +SETUP_COMMONALBUMTITLES_DESC + EN In most cases, SlimServer groups songs from the same album together even if the songs are in different folders. For very common album titles, such as "Greatest Hits", it additionally requires a match on artist name to correctly group tracks from the album. The list below represents the album titles for which SlimServer requires an artist match for album grouping. + SETUP_RESHUFFLEONREPEAT DE Erneutes Mischen bei Wiederholung DK Ny vilkårlig rækkefølge ved gentag