PDA

View Full Version : 6.5 and Various Artists



cjk32
2006-06-11, 12:02
When browsing to Various Artists I get '0 albums with 0 songs by 0
artists.'. I'm using SlimServer v6.5 R7887, all music is imported from
iTunes, and SlimServer is configured to 'Group compilation albums together'
and 'List albums by all artists for that album'.

I've had a cursory glance at the code, and as far as I can see, the results
returned are intended to be those which have a 'Various Artists'
contributor. Indeed, adding records to contributor_album and
contributor_track means that slimserver instead reports 'X albums with Y
songs by 0 artists.', but still no track are listed.

Is this how the system is intended to operate? Any thoughts on what might
be going on?

Chris Key

Dan Sully
2006-06-11, 12:54
* Christopher Key shaped the electrons to say...

>When browsing to Various Artists I get '0 albums with 0 songs by 0
>artists.'. I'm using SlimServer v6.5 R7887, all music is imported from
>iTunes, and SlimServer is configured to 'Group compilation albums together'
>and 'List albums by all artists for that album'.
>
>I've had a cursory glance at the code, and as far as I can see, the results
>returned are intended to be those which have a 'Various Artists'
>contributor. Indeed, adding records to contributor_album and
>contributor_track means that slimserver instead reports 'X albums with Y
>songs by 0 artists.', but still no track are listed.
>
>Is this how the system is intended to operate? Any thoughts on what might
>be going on?

There is logic in the browse modes to determine if any albums under the
current level are Various Artist albums. That logic may not be correct in all
situations..

Run with --d_sql to see the queries being executed against the DB when you
are at the browse level that's showing the VA link.

-D
--
"It has become appallingly obvious that our technology has exceeded our humanity." - Albert Einstein

cjk32
2006-06-11, 13:07
Dan Sully wrote:
> * Christopher Key shaped the electrons to say...
>
>> When browsing to Various Artists I get '0 albums with 0 songs by 0
>> artists.'. I'm using SlimServer v6.5 R7887, all music is imported
>> from iTunes, and SlimServer is configured to 'Group compilation
>> albums together' and 'List albums by all artists for that album'.
>>
>> I've had a cursory glance at the code, and as far as I can see, the
>> results returned are intended to be those which have a 'Various
>> Artists' contributor. Indeed, adding records to contributor_album
>> and contributor_track means that slimserver instead reports 'X
>> albums with Y songs by 0 artists.', but still no track are listed.
>>
>> Is this how the system is intended to operate? Any thoughts on what
>> might be going on?
>
> There is logic in the browse modes to determine if any albums under
> the current level are Various Artist albums. That logic may not be
> correct in all situations..
>

I had a look in Slim::Web::Pages::BrowseDB.pm and Slim::Buttons::BrowseDB;
they both seem to be calling

Slim::Schema->variousArtistsAlbumCount()

and if that returns true, using

Slim::Schema->variousArtistsObject()


> Run with --d_sql to see the queries being executed against the DB
> when you are at the browse level that's showing the VA link.

Running with --d_sql shows that the SQL statement executed when entering
Various Artists is identical to that for any other artist, with the
exception of a different contributor. In the following, 4147 is the
'Various Artists' contributor.

Chris Key

2006-06-11 20:26:09.0778 SELECT me.id, me.name, me.namesort,
me.moodlogic_id, me.moodlogic_mixable, me.musicmagic_mixable, me.namesearch,
me.musicbrainz_id FROM contributors me WHERE ( me.id = ? ) (`4389')
2006-06-11 20:26:09.0865 descend: working on level: [Contributor]
2006-06-11 20:26:09.0879 $self->result_class: [%s]
2006-06-11 20:26:09.0892
$self->result_source->schema->source($level)->result_class: [%s]
2006-06-11 20:26:09.0905 Calling method: [browse]
2006-06-11 20:26:09.1463 descend: working on level: [Album]
2006-06-11 20:26:09.1479 $self->result_class: [%s]
2006-06-11 20:26:09.1490
$self->result_source->schema->source($level)->result_class: [%s]
2006-06-11 20:26:09.1503 Calling method: [descendAlbum]
2006-06-11 20:26:09.1657 SELECT album_2.id, album_2.titlesort,
album_2.contributor, album_2.compilation, album_2.year, album_2.artwork,
album_2.disc, album_2.discc, album_2.musicmagic_mixable,
album_2.titlesearch, album_2.replay_gain, album_2.replay_peak,
album_2.musicbrainz_id, album_2.title FROM contributors me LEFT JOIN
contributor_album contributorAlbums ON ( contributorAlbums.contributor =
me.id ) JOIN albums album ON ( album.id = contributorAlbums.album ) LEFT
JOIN contributor_album contributorAlbums_2 ON (
contributorAlbums_2.contributor = me.id ) JOIN albums album_2 ON (
album_2.id = contributorAlbums_2.album ) WHERE ( ( ( me.id = ? ) AND ( ( (
album.compilation IS NULL ) OR ( album.compilation = ? ) ) AND
contributorAlbums.role IN ( ?, ? ) ) ) ) GROUP BY album_2.id ORDER BY
me.namesort (`4389', `0', `1', `5')

2006-06-11 20:26:22.0803 SELECT me.id, me.name, me.namesort,
me.moodlogic_id, me.moodlogic_mixable, me.musicmagic_mixable, me.namesearch,
me.musicbrainz_id FROM contributors me WHERE ( me.id = ? ) (`4147')
2006-06-11 20:26:22.0925 descend: working on level: [Contributor]
2006-06-11 20:26:22.0944 $self->result_class: [%s]
2006-06-11 20:26:22.0960
$self->result_source->schema->source($level)->result_class: [%s]
2006-06-11 20:26:22.0977 Calling method: [browse]
2006-06-11 20:26:22.1010 descend: working on level: [Album]
2006-06-11 20:26:22.1024 $self->result_class: [%s]
2006-06-11 20:26:22.1039
$self->result_source->schema->source($level)->result_class: [%s]
2006-06-11 20:26:22.1057 Calling method: [descendAlbum]
2006-06-11 20:26:22.1218 SELECT album_2.id, album_2.titlesort,
album_2.contributor, album_2.compilation, album_2.year, album_2.artwork,
album_2.disc, album_2.discc, album_2.musicmagic_mixable,
album_2.titlesearch, album_2.replay_gain, album_2.replay_peak,
album_2.musicbrainz_id, album_2.title FROM contributors me LEFT JOIN
contributor_album contributorAlbums ON ( contributorAlbums.contributor =
me.id ) JOIN albums album ON ( album.id = contributorAlbums.album ) LEFT
JOIN contributor_album contributorAlbums_2 ON (
contributorAlbums_2.contributor = me.id ) JOIN albums album_2 ON (
album_2.id = contributorAlbums_2.album ) WHERE ( ( ( me.id = ? ) AND ( ( (
album.compilation IS NULL ) OR ( album.compilation = ? ) ) AND
contributorAlbums.role IN ( ?, ? ) ) ) ) GROUP BY album_2.id ORDER BY
me.namesort (`4147', `0', `1', `5')

cjk32
2006-06-12, 04:06
Checkin 7898 seems to have fixed one part of the problem. I now see no
'Various Artists' in my artist listing, which I assume is as expected, given
that 'contributor_tracks' and 'contributor_albums' attribute no tracks to
'Various Artists'. Presumably, these records should be being added during a
scan as a result of the 'Part of a compilation' flag in iTunes being set to
'Yes'. If I go in and manually add records to 'contributor_tracks' and
'contributor_albums' to attribute a compilation albums two of its tracks to
'Various Artists', then 'Various Artists' reappears in my artist listing.
Entering that, the web interface reports '1 album with 2 songs by 0
artists.', but no tracks are listed. The SQL statements refreshing this
page after a clean start are as shown below. I think that the last
statement is significant, as it appears to be searching for albums
attributed 'Various Artists' that are not compilations, something of a
contradiction. If I now go in and set the compilation flag to zero for the
album in question (in the 'albums' table), then the web interface reports '1
album with 2 songs by 1 artists.', and the album is listed below. Selecting
that albums then shows its full contents.

I take it this means that the solution is to have the importer add the
necessary records to 'contributor_tracks' and 'contributor_albums', and to
fix the SQL used for various artists.

Chris Key

2006-06-12 11:47:34.4247 SELECT me.id, me.name, me.namesort, me.namesearch,
me.moodlogic_id, me.moodlogic_mixable, me.musicmagic_mixable FROM genres me
WHERE (name = ? ) (`Podcasts')

2006-06-12 11:47:34.4638 SELECT me.id, me.name, me.namesort, me.namesearch,
me.moodlogic_id, me.moodlogic_mixable, me.musicmagic_mixable FROM genres me
()

2006-06-12 11:47:35.0809 SELECT COUNT( * ) FROM tracks me ()
$VAR1 = {
'album' => 'track',
'contributor' => 'album'
};
$VAR1 = {
'album.compilation' => '1',
'contributor.id' => '4798'
};

2006-06-12 11:47:58.3060 working on levelname: [album]

2006-06-12 11:47:58.3067 working on levelname: [contributor]

2006-06-12 11:47:58.3097 SELECT me.id, me.name, me.namesort,
me.moodlogic_id, me.moodlogic_mixable, me.musicmagic_mixable, me.namesearch,
me.musicbrainz_id FROM contributors me WHERE ( me.id = ? ) (`4798')

2006-06-12 11:47:58.3613 SELECT COUNT( DISTINCT( me.id ) ) FROM tracks me
LEFT JOIN contributor_track contributorTracks ON ( contributorTracks.track =
me.id )
JOIN contributors contributor ON ( contributor.id =
contributorTracks.contributor ) WHERE ( contributor.id = ? AND
contributorTracks.role IN ( ?, ? ) ) (`4798', `1', `5')

2006-06-12 11:47:58.4213 SELECT COUNT( DISTINCT( me.id ) ) FROM albums me
LEFT JOIN tracks tracks ON ( tracks.album = me.id ) LEFT JOIN
contributor_track contributorTracks ON ( contributorTracks.track = tracks.id
) WHERE ( contributorTracks.contributor = ? ) (`4798')

2006-06-12 11:47:58.4417 SELECT COUNT( DISTINCT( me.id ) ) FROM contributors
me LEFT JOIN contributor_track contributorTracks ON (
contributorTracks.contributor = me.id ) LEFT JOIN contributor_album
contributorAlbums ON ( contributorAlbums.contributor = me.id ) JOIN albums
album ON ( album.id = contributorAlbums.album ) WHERE ( ( ( ( (
album.compilation IS NULL ) OR ( album.compilation = ? ) ) ) AND (
contributorTracks.role IN ( ?, ? ) AND me.id = ? ) ) ) (`0', `1', `5',
`4798')

2006-06-12 11:47:58.4492 SELECT me.id, me.name, me.namesort,
me.moodlogic_id, me.moodlogic_mixable, me.musicmagic_mixable, me.namesearch,
me.musicbrainz_id FROM contributors me WHERE ( me.id = ? ) (`4798')

2006-06-12 11:47:58.4519 find:
$VAR1 = {
'album' => {
'me.id' => '4798'
},
'track' => {
'me.compilation' => '1'
}
};

2006-06-12 11:47:58.4528 running resultset on: album

2006-06-12 11:47:58.4531 descend: working on level: [Contributor]

2006-06-12 11:47:58.4533 $self->result_class: [%s]

2006-06-12 11:47:58.4537
$self->result_source->schema->source($level)->result_class: [%s]

2006-06-12 11:47:58.4541 Calling method: [browse]

2006-06-12 11:47:58.4558 descend: working on level: [Album]

2006-06-12 11:47:58.4560 $self->result_class: [%s]

2006-06-12 11:47:58.4563
$self->result_source->schema->source($level)->result_class: [%s]

2006-06-12 11:47:58.4567 Calling method: [descendAlbum]

2006-06-12 11:47:58.4716 SELECT COUNT( DISTINCT( album_2.id ) ) FROM
contributors me LEFT JOIN contributor_album contributorAlbums ON (
contributorAlbums.contributor = me.id ) JOIN albums album ON ( album.id =
contributorAlbums.album ) LEFT JOIN contributor_album contributorAlbums_2 ON
( contributorAlbums_2.contributor = me.id ) JOIN albums album_2 ON (
album_2.id = contributorAlbums_2.album ) WHERE ( ( ( ( ( me.id = ? ) AND ( (
( album.compilation IS NULL ) OR ( album.compilation = ? ) ) AND
contributorAlbums.role IN ( ?, ? ) ) ) ) ) ) (`4798', `0', `1', `5')

cjk32
2006-06-12, 04:11
One other bug that came out of the various tests is that during a full wipe
and rescan, the 'Various Artists' contributor gets deleted and replaced,
getting a new id. SlimServer doesn't however pick this up, and continues to
use the old id until it's restarted.

Chris