Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog9.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ <h2><a name="v9.2.0" id="v9.2.0"></a>Version 9.2.0</h2>
<li><a href="https://github.com/LMS-Community/slimserver/issues/1286">#1286</a> - Display album cover for AudioAddict stations (inspired by some work by @mcduman)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1541">#1541</a> - Add per-player timezone support: players can now display date and time, and fire alarms, in their own timezone rather than the server's. (@boudekerk)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1546">#1546</a> - Add "Default Adjustment for Local Tracks" player option. (@SamInPgh)</li>
<li><a href="https://github.com/LMS-Community/slimserver/issues/1555">#1555</a> - Store display_artist from ALBUMARTIST/ARTIST tags separately from individual contributors. Optional use of ALBUMARTISTS/ARTISTS plural tags for contributor creation. (@Rouzax)</li>
</ul>
<br />

Expand Down
9 changes: 9 additions & 0 deletions HTML/EN/settings/server/behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@
</select>
[% END %]

[% WRAPPER setting title="SETUP_USEPLURALARTISTTAGS" desc="SETUP_USEPLURALARTISTTAGS_DESC"%]
<select class="stdedit" name="pref_usePluralArtistTags" id="usePluralArtistTags">

<option [% IF NOT prefs.pref_usePluralArtistTags %]selected [% END %]value="0">[% 'SETUP_USEPLURALARTISTTAGS_0' | string %]</option>
<option [% IF prefs.pref_usePluralArtistTags %]selected [% END %]value="1">[% 'SETUP_USEPLURALARTISTTAGS_1' | string %]</option>

</select>
[% END %]

[% WRAPPER setting title="SETUP_YEARMENU" desc="SETUP_YEARMENU_DESC"%]
<select class="stdedit" name="pref_onlyAlbumYears" id="onlyAlbumYears">

Expand Down
2 changes: 2 additions & 0 deletions SQL/SQLite/schema_27_up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE albums ADD display_artist blob;
ALTER TABLE tracks ADD display_artist blob;
41 changes: 15 additions & 26 deletions Slim/Control/Queries.pm
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,7 @@ sub albumsQuery {
# We need the main albums.contributor name for favorites, so always do this join unless getting count only.
$sql .= 'JOIN contributors ON contributors.id = albums.contributor ';
$c->{'contributors.name'} = 1;
$c->{'albums.label'} = 1;
# $sql .= 'LEFT JOIN contributor_display ON albums.display_contributor = contributor_display.id ';
# $c->{'contributor_display.name'} = 1;
$c->{'albums.display_artist'} = 1;
}

if ( $tags =~ /s/ ) {
Expand Down Expand Up @@ -840,8 +838,7 @@ sub albumsQuery {
utf8::decode( $c->{'composer.name'} ) if exists $c->{'composer.name'};
utf8::decode( $c->{'tracks.performance'} ) if exists $c->{'tracks.performance'};
utf8::decode( $c->{'contributors.name'} ) if exists $c->{'contributors.name'};
# utf8::decode( $c->{'contributor_display.name'} ) if exists $c->{'contributor_display.name'};
utf8::decode( $c->{'albums.label'} ) if exists $c->{'albums.label'};
utf8::decode( $c->{'albums.display_artist'} ) if exists $c->{'albums.display_artist'};
$request->addResultLoop($loopname, $chunkCount, 'id', $c->{'albums.id'});
$request->addResultLoopIfValueDefined($loopname, $chunkCount, 'work_id', $c->{'tracks.work'});
$request->addResultLoopIfValueDefined($loopname, $chunkCount, 'work_name', $c->{'works.title'});
Expand Down Expand Up @@ -904,9 +901,8 @@ sub albumsQuery {
#Don't use albums.contributor to set artist_id/artist for Works, it may well be completely wrong!
if ( !$work ) {
$tags =~ /S/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'artist_id', $c->{'albums.contributor'});
$tags =~ /a/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'artist', $c->{'contributors.name'});
# $tags =~ /a/ && $c->{'contributor_display.name'} && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'display_artist', $c->{'contributor_display.name'});
$tags =~ /a/ && $c->{'albums.label'} && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'display_artist', $c->{'albums.label'});
$tags =~ /a/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'artist', $c->{'albums.display_artist'} || $c->{'contributors.name'});
$tags =~ /a/ && $c->{'albums.display_artist'} && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'display_artist', $c->{'albums.display_artist'});
$tags =~ /4/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'portraitid', $c->{'contributors.portraitid'});
}

Expand Down Expand Up @@ -5799,9 +5795,9 @@ sub _songDataFromHash {
$returnHash{$role} = $res->{$role};
}
}
# also return contributor_display.name
# $returnHash{'display_artist'} = $res->{'contributor_display.name'} if $res->{'contributor_display.name'};
$returnHash{'display_artist'} = $res->{'albums.label'} if $res->{'albums.label'};

my $da = $res->{'tracks.display_artist'} || $res->{'albums.display_artist'};
$returnHash{display_artist} = $da if $da;
}
elsif ( $tag eq 'S' ) {
for my $role ( @contributorRoles ) {
Expand Down Expand Up @@ -6402,13 +6398,6 @@ sub _getTagDataForTracks {
}
};

# my $join_contributor_display = sub {
# if ( $sql !~ /JOIN contributor_display/ ) {
# $join_albums->();
# $sql .= 'LEFT JOIN contributor_display ON albums.display_contributor = contributor_display.id ';
# }
# };

if ( my $year = $args->{year} ) {
push @{$w}, 'tracks.year = ?';
push @{$p}, $year;
Expand Down Expand Up @@ -6514,13 +6503,6 @@ sub _getTagDataForTracks {
$tags =~ /[as]/ && do {
$join_contributors->();
$c->{'contributors.name'} = 1 if $tags =~ /a/;

# $join_contributor_display->();
# $c->{'contributor_display.name'} = 1;
$join_albums->();
$c->{'albums.label'} = 1;



# only albums on which the contributor has a specific role?
my @roles;
Expand Down Expand Up @@ -6550,6 +6532,12 @@ sub _getTagDataForTracks {
$c->{'contributors.portraitid'} = 1;
};

$tags =~ /[aA]/ && do {
$join_albums->();
$c->{'albums.display_artist'} = 1;
$c->{'tracks.display_artist'} = 1;
};

$tags =~ /l/ && do {
$join_albums->();
$c->{'albums.title'} = 1;
Expand Down Expand Up @@ -6680,11 +6668,12 @@ sub _getTagDataForTracks {
utf8::decode( $c->{'tracks.lyrics'} ) if exists $c->{'tracks.lyrics'};
utf8::decode( $c->{'albums.title'} ) if exists $c->{'albums.title'};
utf8::decode( $c->{'contributors.name'} ) if exists $c->{'contributors.name'};
utf8::decode( $c->{'contributor_display.name'} ) if exists $c->{'contributor_display.name'};
utf8::decode( $c->{'genres.name'} ) if exists $c->{'genres.name'};
utf8::decode( $c->{'comments.value'} ) if exists $c->{'comments.value'};
utf8::decode( $c->{'tracks.discsubtitle'}) if exists $c->{'tracks.discsubtitle'};
utf8::decode( $c->{'tracks.grouping'}) if exists $c->{'tracks.grouping'};
utf8::decode( $c->{'albums.display_artist'}) if exists $c->{'albums.display_artist'};
utf8::decode( $c->{'tracks.display_artist'}) if exists $c->{'tracks.display_artist'};
}

my $id = $c->{'tracks.id'};
Expand Down
5 changes: 3 additions & 2 deletions Slim/Plugin/FullTextSearch/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ use constant SQL_CREATE_TRACK_ITEM => q{
UNIQUE_TOKENS(LOWER(IFNULL(tracks.title, '')) || ' ' || IFNULL(tracks.titlesearch, '') || ' ' || IFNULL(tracks.customsearch, '')),
-- weight 5
UNIQUE_TOKENS(IFNULL(tracks.year, '') || ' ' || GROUP_CONCAT(albums.title, ' ') || ' ' || GROUP_CONCAT(albums.titlesearch, ' ') || ' '
|| GROUP_CONCAT(genres.name, ' ') || ' ' || GROUP_CONCAT(genres.namesearch, ' ')),
|| GROUP_CONCAT(genres.name, ' ') || ' ' || GROUP_CONCAT(genres.namesearch, ' ') || ' '
|| IFNULL(tracks.display_artist, '') || ' ' || IFNULL(albums.display_artist, '')),
-- weight 3 - contributors create multiple hits, therefore only w3
UNIQUE_TOKENS(CONCAT_CONTRIBUTOR_ROLE(tracks.id, GROUP_CONCAT(contributor_track.contributor, ','), 'contributor_track') || ' '
|| IGNORE_CASE(comments.value) || ' ' || IGNORE_CASE(tracks.lyrics) || ' ' || IFNULL(tracks.content_type, '') || ' '
Expand Down Expand Up @@ -112,7 +113,7 @@ use constant SQL_CREATE_ALBUM_ITEM => qq{
UNIQUE_TOKENS(LOWER(IFNULL(albums.title, '')) || ' ' || IFNULL(albums.titlesearch, '') || ' ' || IFNULL(albums.customsearch, '') || ' '
|| IFNULL((SELECT GROUP_CONCAT(wt,' ') FROM (SELECT DISTINCT works.titlesearch wt FROM tracks JOIN works ON tracks.work = works.id WHERE tracks.album = albums.id) ), ' ') ),
-- weight 5
IFNULL(albums.year, ''),
UNIQUE_TOKENS(IFNULL(albums.year, '') || ' ' || IFNULL(albums.display_artist, '')),
-- weight 3
UNIQUE_TOKENS(CONCAT_CONTRIBUTOR_ROLE(albums.id, GROUP_CONCAT(contributor_album.contributor, ','), 'contributor_album')),
-- weight 1
Expand Down
Loading