Skip to content

Commit

Permalink
Merge pull request #1186 from darrell-k/optional-track-artist-for-com…
Browse files Browse the repository at this point in the history
…bined-list

make track artist optional in combined artist list
  • Loading branch information
michaelherger authored Oct 19, 2024
2 parents 5f78451 + a703c7e commit 5d7e146
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 33 deletions.
4 changes: 4 additions & 0 deletions HTML/EN/settings/server/behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

[% 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 @@ -22,6 +25,7 @@
<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
2 changes: 1 addition & 1 deletion Slim/Control/Queries.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ sub artistsQuery {
}
elsif ($prefs->get('useUnifiedArtistsList')) {
# include user-defined roles that user wants in artist list
$roles = Slim::Schema->artistOnlyRoles( Slim::Schema::Contributor->getUserDefinedRolesToInclude(), 'TRACKARTIST' );
$roles = Slim::Schema->artistOnlyRoles( Slim::Schema::Contributor->getUserDefinedRolesToInclude() );
}
else {
# include user-defined roles that user wants in artist list
Expand Down
4 changes: 2 additions & 2 deletions 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' ) {
foreach my $pref ( 'noGenreFilter', 'noRoleFilter', 'useUnifiedArtistsList', 'composerInArtists', 'conductorInArtists', 'bandInArtists', 'trackartistInArtists' ) {
if (!defined $cached->{$pref} && !$passwordProtected{$serverId}) {
push @prefsFetcher, sub {
__PACKAGE__->remoteRequest($serverId,
Expand Down Expand Up @@ -511,4 +511,4 @@ sub getServerDetails {
}
}

1;
1;
2 changes: 1 addition & 1 deletion Slim/Schema/Album.pm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ sub artists {
my @artists = $self->artistsForRoles('ALBUMARTIST');

# If the user wants to use BAND as album artist, pull that.
if (scalar @artists == 0 && $prefs->get('bandInArtists')) {
if (scalar @artists == 0 && $prefs->get('bandInArtists')) { ##?????

@artists = $self->artistsForRoles('BAND');
}
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', 'TRACKARTIST', 'ALBUMARTIST' );
my @roles = ( 'ARTIST', '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
4 changes: 2 additions & 2 deletions Slim/Schema/ResultSet/Contributor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sub searchNames {
};

# Bug: 2479 - Don't include roles if the user has them unchecked.
if (my $roles = Slim::Schema->artistOnlyRoles('TRACKARTIST')) {
if (my $roles = Slim::Schema->artistOnlyRoles()) {

$cond->{'contributorAlbums.role'} = { 'in' => $roles };
push @joins, 'contributorAlbums';
Expand All @@ -46,7 +46,7 @@ sub countTotal {
my $cond = {};
my @joins = ();
my $roles = $prefs->get('useUnifiedArtistsList')
? Slim::Schema->artistOnlyRoles(Slim::Schema::Contributor::getUserDefinedRolesToInclude(), 'TRACKARTIST')
? Slim::Schema->artistOnlyRoles(Slim::Schema::Contributor::getUserDefinedRolesToInclude())
: [ Slim::Schema::Contributor->contributorRoleIds ];

# The user may not want to include all the composers / conductors
Expand Down
3 changes: 2 additions & 1 deletion Slim/Utils/Prefs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ sub init {
'composerInArtists' => 0,
'conductorInArtists' => 0,
'bandInArtists' => 0,
'trackartistInArtists' => 0,
'userDefinedRoles' => {},
'variousArtistAutoIdentification' => 1,
'useUnifiedArtistsList' => 0,
Expand Down Expand Up @@ -546,7 +547,7 @@ sub init {
# Rebuild Jive cache if VA setting is changed
$prefs->setChange( sub {
Slim::Schema->wipeCaches();
}, 'variousArtistAutoIdentification', 'composerInArtists', 'conductorInArtists', 'bandInArtists', 'useUnifiedArtistsList', 'userDefinedRoles');
}, 'variousArtistAutoIdentification', 'composerInArtists', 'conductorInArtists', 'bandInArtists', 'trackartistInArtists', 'useUnifiedArtistsList', 'userDefinedRoles');

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

$params->{'search'}->{'contributor_namesearch'} = {
map { ('active' . $_) => 1 } @{
Slim::Schema->artistOnlyRoles(Slim::Schema::Contributor::getUserDefinedRolesToInclude(), 'TRACKARTIST')
Slim::Schema->artistOnlyRoles(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 variousArtistAutoIdentification
conductorInArtists bandInArtists trackartistInArtists 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 variousArtistAutoIdentification titleFormat titleFormatWeb language useUnifiedArtistsList
composerInArtists conductorInArtists bandInArtists trackartistInArtists variousArtistAutoIdentification titleFormat titleFormatWeb language useUnifiedArtistsList
groupArtistAlbumsByReleaseType ignoreReleaseTypes releaseTypesToIgnore showComposerReleasesbyAlbum showComposerReleasesbyAlbumGenres onlyAlbumYears userDefinedRoles) );
}

Expand Down
44 changes: 22 additions & 22 deletions strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8785,38 +8785,38 @@ 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 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
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 de la piste, Compositeur, groupe et 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
JA 「アーチスト」に、作曲家、バンド、オーケストラ
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 有关艺人的作曲家及乐队信息
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 音轨艺人有关艺人的作曲家及乐队信息

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 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.
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.
FI Artistiluetteloon voidaan lisätä kappaletietoja säveltäjistä, yhtyeistä ja orkestereista selaamista ja hakuja varten.
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.
FR Les informations relatives au artistes de la piste, 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.
JA 作曲家、バンド、オーケストラの情報は、ブラウズ・検索の時にアーチスト情報として認識させることができます。
NL Je kunt informatie over componisten, dirigenten en bands in de lijst van artiesten opnemen, zodat je erin kunt bladeren en zoeken.
NL Je kunt informatie over artiest van nummer, componisten, dirigenten en bands in de lijst van artiesten opnemen, zodat je erin kunt bladeren en zoeken.
NO Sanginformasjon om komponist, gruppe og orkester kan inkluderes i artistlisten når du blar og søker.
PL Wyświetlaj kompozytorów oraz nazwy zespołów i orkiestr na liście wykonawców.
PT A informação relativa ao compositor, banda e orquestra poderá ser incluida na listas ou na procura.
Expand Down

0 comments on commit 5d7e146

Please sign in to comment.