Skip to content

Commit

Permalink
Make TRACKARTIST a fix part of the unified artists browse list.
Browse files Browse the repository at this point in the history
This reverts PR LMS-Community#1186 in large parts, but adds some more consequent use of `Slim::Schema::Contributor->unifiedArtistsListRoles` instead. I believe the motivation for LMS-Community#1186 was to include custom roles in search result sets. This is one place where this PR does things differently than before LMS-Community#1186.

`TRACKARTIST` had been in the unified artists list for > 10 years. Removing it or making it optional IMHO was our mistake. But I believe we only did so in order to use other methods compiling role lists. This change will hopefully do the best of both...
  • Loading branch information
michaelherger committed Oct 23, 2024
1 parent 42ab4e1 commit 835646c
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 49 deletions.
4 changes: 0 additions & 4 deletions HTML/EN/settings/server/behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

[% IF prefs.pref_useUnifiedArtistsList; WRAPPER settingSection %]
[% WRAPPER settingGroup title="SETUP_COMPOSERINARTISTS" desc="SETUP_COMPOSERINARTISTS_DESC" %]
<input type="checkbox" [% IF prefs.pref_trackartistInArtists %]checked="1" [% END %] class="stdedit" name="pref_trackartistInArtists" id="trackartistInArtists" value="1" />
<label for="trackartistInArtists" class="stdlabel">[% "TRACKARTIST" | string %]</label><br>

<input type="checkbox" [% IF prefs.pref_composerInArtists %]checked="1" [% END %] class="stdedit" name="pref_composerInArtists" id="composerInArtists" value="1" />
<label for="composerInArtists" class="stdlabel">[% "COMPOSER" | string %]</label><br>

Expand All @@ -25,7 +22,6 @@
<label for="bandInArtists" class="stdlabel">[% "BAND" | string %]</label>
[% END %]
[% END; ELSE %]
<input type="hidden" name="pref_trackartistInArtists" value="[% prefs.pref_trackartistInArtists | html %]" />
<input type="hidden" name="pref_composerInArtists" value="[% prefs.pref_composerInArtists | html %]" />
<input type="hidden" name="pref_conductorInArtists" value="[% prefs.pref_conductorInArtists | html %]" />
<input type="hidden" name="pref_bandInArtists" value="[% prefs.pref_bandInArtists | html %]" />
Expand Down
19 changes: 7 additions & 12 deletions Slim/Control/Queries.pm
Original file line number Diff line number Diff line change
Expand Up @@ -778,15 +778,11 @@ sub albumsQuery {
},
join(',', map { Slim::Schema::Contributor->typeToRole($_) } @roles));
} else {
# TODO - should this be using Slim::Schema->artistOnlyRoles?
my @roles = ( 'ARTIST', 'ALBUMARTIST' );

if ($prefs->get('useUnifiedArtistsList')) {
# Loop through each pref to see if the user wants to show that contributor role.
foreach (Slim::Schema::Contributor->contributorRoles) {
if ($prefs->get(lc($_) . 'InArtists')) {
push @roles, $_;
}
}
@roles = Slim::Schema::Contributor->unifiedArtistsListRoles();
}

$contributorSql = sprintf( qq{
Expand Down Expand Up @@ -1033,19 +1029,18 @@ sub artistsQuery {
my $roles;
if ($roleID) {
$roleID .= ',ARTIST' if $aa_merge;
$roles = [ map { Slim::Schema::Contributor->typeToRole($_) } split(/,/, $roleID ) ];
$roles = [ split(/,/, $roleID ) ];
}
elsif ($prefs->get('useUnifiedArtistsList')) {
# include user-defined roles that user wants in artist list
$roles = Slim::Schema->artistOnlyRoles( Slim::Schema::Contributor->getUserDefinedRolesToInclude() );
$roles = [ Slim::Schema::Contributor->unifiedArtistsListRoles() ];
}
else {
# include user-defined roles that user wants in artist list
$roles = [ map {
Slim::Schema::Contributor->typeToRole($_);
} Slim::Schema::Contributor->defaultContributorRoles(), Slim::Schema::Contributor->getUserDefinedRolesToInclude() ];
$roles = [ Slim::Schema::Contributor->defaultContributorRoles(), Slim::Schema::Contributor->getUserDefinedRolesToInclude() ];
}

$roles = [ sort map { Slim::Schema::Contributor->typeToRole($_) } @$roles ];

if ( defined $genreID ) {
my @genreIDs = split(/,/, $genreID);

Expand Down
2 changes: 1 addition & 1 deletion Slim/Plugin/RemoteLibrary/LMS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ sub _getBrowsePrefs {
my $cacheKey = $serverId . '_prefs';
my $cached = $cache->get($cacheKey) || {};

foreach my $pref ( 'noGenreFilter', 'noRoleFilter', 'useUnifiedArtistsList', 'composerInArtists', 'conductorInArtists', 'bandInArtists', 'trackartistInArtists' ) {
foreach my $pref ( 'noGenreFilter', 'noRoleFilter', 'useUnifiedArtistsList', 'composerInArtists', 'conductorInArtists', 'bandInArtists' ) {
if (!defined $cached->{$pref} && !$passwordProtected{$serverId}) {
push @prefsFetcher, sub {
__PACKAGE__->remoteRequest($serverId,
Expand Down
2 changes: 1 addition & 1 deletion Slim/Schema/Contributor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ sub defaultContributorRoles {
}

sub unifiedArtistsListRoles {
my @roles = ( 'ARTIST', 'ALBUMARTIST' );
my @roles = ( 'ARTIST', 'TRACKARTIST', 'ALBUMARTIST' );

# Loop through each pref to see if the user wants to show that contributor role. Also include user-defined roles.
push @roles, grep { $prefs->get(lc($_) . 'InArtists') } contributorRoles();
Expand Down
12 changes: 7 additions & 5 deletions Slim/Schema/ResultSet/Contributor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sub searchNames {
$cond->{'contributorAlbums.role'} = { 'in' => $roles };
push @joins, 'contributorAlbums';
}

my $collate = Slim::Utils::OSDetect->getOS()->sqlHelperClass()->collate();

$attrs->{'order_by'} ||= "me.namesort $collate";
Expand All @@ -45,9 +45,11 @@ sub countTotal {

my $cond = {};
my @joins = ();
my $roles = $prefs->get('useUnifiedArtistsList')
? Slim::Schema->artistOnlyRoles(Slim::Schema::Contributor::getUserDefinedRolesToInclude())
: [ Slim::Schema::Contributor->contributorRoleIds ];
my $roles = [
$prefs->get('useUnifiedArtistsList')
? sort map { Slim::Schema::Contributor->typeToRole($_) } Slim::Schema::Contributor->unifiedArtistsListRoles()
: Slim::Schema::Contributor->contributorRoleIds
];

# The user may not want to include all the composers / conductors
if ($roles) {
Expand All @@ -64,7 +66,7 @@ sub countTotal {

push @joins, 'contributorAlbums';
}

my $collate = Slim::Utils::OSDetect->getOS()->sqlHelperClass()->collate();

return $self->search($cond, {
Expand Down
3 changes: 1 addition & 2 deletions Slim/Utils/Prefs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ sub init {
'composerInArtists' => 0,
'conductorInArtists' => 0,
'bandInArtists' => 0,
'trackartistInArtists' => 0,
'userDefinedRoles' => {},
'variousArtistAutoIdentification' => 1,
'useUnifiedArtistsList' => 0,
Expand Down Expand Up @@ -547,7 +546,7 @@ sub init {
# Rebuild Jive cache if VA setting is changed
$prefs->setChange( sub {
Slim::Schema->wipeCaches();
}, 'variousArtistAutoIdentification', 'composerInArtists', 'conductorInArtists', 'bandInArtists', 'trackartistInArtists', 'useUnifiedArtistsList', 'userDefinedRoles');
}, 'variousArtistAutoIdentification', 'composerInArtists', 'conductorInArtists', 'bandInArtists', 'useUnifiedArtistsList', 'userDefinedRoles');

$prefs->setChange( sub {
Slim::Control::Queries->wipeCaches();
Expand Down
6 changes: 5 additions & 1 deletion Slim/Web/Pages/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,11 @@ sub _initActiveRoles {

$params->{'search'}->{'contributor_namesearch'} = {
map { ('active' . $_) => 1 } @{
Slim::Schema->artistOnlyRoles(Slim::Schema::Contributor::getUserDefinedRolesToInclude())
Slim::Schema->artistOnlyRoles(
$prefs->get('useUnifiedArtistsList')
? Slim::Schema::Contributor->unifiedArtistsListRoles()
: Slim::Schema::Contributor::getUserDefinedRolesToInclude()
)
}
} unless keys %{$params->{'search'}->{'contributor_namesearch'}};
}
Expand Down
2 changes: 1 addition & 1 deletion Slim/Web/Settings/Server/Behavior.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sub prefs {
return ($prefs,
qw(noGenreFilter noRoleFilter searchSubString ignoredarticles splitList
browseagelimit groupdiscs persistPlaylists reshuffleOnRepeat saveShuffled composerInArtists
conductorInArtists bandInArtists trackartistInArtists variousArtistAutoIdentification
conductorInArtists bandInArtists variousArtistAutoIdentification
ignoreReleaseTypes cleanupReleaseTypes groupArtistAlbumsByReleaseType
useTPE2AsAlbumArtist variousArtistsString ratingImplementation useUnifiedArtistsList
skipsentinel showComposerReleasesbyAlbum showComposerReleasesbyAlbumGenres onlyAlbumYears)
Expand Down
2 changes: 1 addition & 1 deletion Slim/Web/XMLBrowser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if ( !main::SCANNER ) {
Slim::Control::Request::subscribe( \&wipeCaches, [['library','rescan','favorites'], ['changed','done','changed']] );

$prefs->setChange( \&wipeCaches, qw(itemsPerPage thumbSize showArtist showYear additionalPlaylistButtons noGenreFilter noRoleFilter searchSubString browseagelimit
composerInArtists conductorInArtists bandInArtists trackartistInArtists variousArtistAutoIdentification titleFormat titleFormatWeb language useUnifiedArtistsList
composerInArtists conductorInArtists bandInArtists variousArtistAutoIdentification titleFormat titleFormatWeb language useUnifiedArtistsList
groupArtistAlbumsByReleaseType ignoreReleaseTypes releaseTypesToIgnore showComposerReleasesbyAlbum showComposerReleasesbyAlbumGenres onlyAlbumYears userDefinedRoles) );
}

Expand Down
42 changes: 21 additions & 21 deletions strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8785,33 +8785,33 @@ SETUP_NOROLEFILTER_DESC
SV När du bläddrar genom "Artister" kan du filtrera så att bara album och låtar som matchar den valda rollen ("ALBUMARTIST", "COMPOSER", etc.) visas.

SETUP_COMPOSERINARTISTS
CS Interpret skladby, Skladatel, Skupina a Orchestr v Interpretech
DA Nummerets kunstner, Komponist, band og orkester i Kunstnere
DE Titelinterpret, Komponist, Gruppe und Orchester in Interpreten
EN Track Artist, Composer, Band and Orchestra in Artists
ES Artista de pista, Compositor, banda y orquesta en artistas
FI Raidan artisti, Säveltäjä, yhtye ja orkesteri artisteissa
FR Artiste du morceau, compositeur, groupe/orchestre dans les artistes
HE מלחינים, להקות ותזמורות בין המבצעים, מבצע הרצועה
HU Zeneszám előadója, Zeneszerző, együttes és zenekar a előadóknál
IT Artista brano, Compositore, gruppo e orchestra in Artisti
CS Skladatel, Skupina a Orchestr v Interpretech
DA Komponist, band og orkester i Kunstnere
DE Komponist, Gruppe und Orchester in Interpreten
EN Composer, Band and Orchestra in Artists
ES Compositor, banda y orquesta en artistas
FI Säveltäjä, yhtye ja orkesteri artisteissa
FR Compositeur, groupe et orchestre dans les artistes
HE מלחינים, להקות ותזמורות בין המבצעים
HU Zeneszerző, együttes és zenekar a előadóknál
IT Compositore, gruppo e orchestra in Artisti
JA 「アーチスト」に、作曲家、バンド、オーケストラ
NL Artiest van nummer, Componist, dirigent en band in lijst met artiesten
NO Sporartist, Komponist, band og orkester i Artister
PL Wykonawca utworu, Kompozytor, zespół i orkiestra jako wykonawcy
PT Artista da pista, Compositor, Banda e Orquestra em Artistas
RU Исполнитель дорожки, Поле "Исполнители": композитор, группа и оркестр
SV Spårets artist, Kompositör, band och orkester i Artister
ZH_CN 音轨艺人有关艺人的作曲家及乐队信息
NL Componist, dirigent en band in lijst met artiesten
NO Komponist, band og orkester i Artister
PL Kompozytor, zespół i orkiestra jako wykonawcy
PT Compositor, Banda e Orquestra em Artistas
RU Поле "Исполнители": композитор, группа и оркестр
SV Kompositör, band och orkester i Artister
ZH_CN 有关艺人的作曲家及乐队信息

SETUP_COMPOSERINARTISTS_DESC
CS Informace o skladatelích, skupinách a orchestrech mohou být přidány do seznamu interpretů pro procházení a vyhledávání.
DA Der kan vises oplysninger om hvem der har komponeret og hvem der spiller de forskellige numre, i listen med kunstnere når du gennemser eller søger i din musiksamling.
DE Titelinformationen über Nummerets kunstner, Komponist, Gruppe und Orchester können in der Interpretenliste und beim Suchen aufgenommen werden.
EN Song information about track artists, composers, bands and orchestras can be included in the artists list for browsing and search.
ES La información de canción sobre artistas de pista, compositores, bandas y orquestas se puede incluir en la lista de artistas para examinar y buscar.
DE Titelinformationen über Komponist, Gruppe und Orchester können in der Interpretenliste und beim Suchen aufgenommen werden.
EN Song information about composers, bands and orchestras can be included in the artists list for browsing and search.
ES La información de canción sobre compositores, bandas y orquestas se puede incluir en la lista de artistas para examinar y buscar.
FI Artistiluetteloon voidaan lisätä kappaletietoja säveltäjistä, yhtyeistä ja orkestereista selaamista ja hakuja varten.
FR Les informations relatives aux artistes des morceaux, compositeurs, groupes/orchestres peuvent être ajoutées à la liste des artistes pour le parcours de bibliothèque et les recherches.
FR Les informations relatives au compositeur, au groupe et à l'orchestre contenues dans les morceaux peuvent être ajoutées à la liste d'artistes pour parcourir ou rechercher.
HE ניתן לכלול פרטי שירים אודות מלחינים, להקות ותזמורות ברשימת המבצעים לצורך עיון וחיפוש.
HU A zeneszerzőkről, együttesekről és zenekarokról szóló dalinformációk böngészéshez és kereséshez felvehetők az előadók listájába.
IT Per ogni brano, nell'elenco degli artisti è possibile includere informazioni su compositore, gruppo e orchestra a fini di consultazione e ricerca.
Expand Down

0 comments on commit 835646c

Please sign in to comment.