-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix albumsQuery artist and artist_id #1206
base: public/9.0
Are you sure you want to change the base?
Fix albumsQuery artist and artist_id #1206
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't really fix the issue, does it? It does check for the existence of $contributorID
and $c->{albums.contributor}
only for the name, but not for the ID. The latter would always be the ID from the query response. The problem seems to be inverted (always ID from database, rather than query instead of the opposite), but not fixed?
It would always use the ID from the database,
albums.contributor will always be consistent as it's a column from the base albums table. The problem is that contributor.name from the query is from the contributors table (via a join with contributor_album) where there is a match on the input parm. It certainly took me a few brain cycles to get my head around this, but my testing of 3 scenarios (no input contributor, input contributor same as album contributor and input contributor different to album contributor) makes me believe I've got this right. But feel free to prove me wrong! |
My simplistic take is: whatever was passed, the Would you have an example how I can reproduce the problem? |
You need to browse an artist who appears on the album but is not the main artist (as defined by albums.contributor). A trackartist, perhaps? (I've seen it with user-defined tags, and conductor, so you could just add "Conductor=Michael" to an album.) Then use curl to submit a jsonrpc request, because I'm still not sure how to see the bug in the UI. You make an interesting point about the initial query SQL: should it join to contributors on albums.contributor or contributor_album.contributor for contributors.name? It might do either, depending on the input parameters, including And whatever we get in contributor.name is used in generating the favoritesUrl which seems to work correctly at present, but I'll check with various parameters to trigger both cases. (presumably when you said artist.contributor above you meant albums.contributor?) |
Actually, Favorites are NOT working when added in this case - it definitely needs the name associated with albums.contributor. Another ancient bug referenced here: slimserver/Slim/Control/Queries.pm Lines 617 to 633 in a1719ae
Maybe we could join to contributors twice, once on albums.contributor and again on contributor_album.contributor, to get both names and use as appropriate in the result loop processing to avoid that extra SQL call in the loop? |
OK, I think that latest push is the solution. One other point: should creating |
Did you run any performance tests? That's creating a (potentially) second relation to the contributors table, which will come at a cost, right? |
It shouldn't depend on that tag, no. Which probably means everything can be simplified further? We'll always need that relation? |
I would think performance would be better. For tag This remains true even if we remove the conditioning on tag |
True, I should have asked the question before you added the additional query in the loop 😁. Are you doing to look into the unconditional relation? |
To be fair to me, the extra query in the loop was already there 😁. Yes, I'm going to do the new join always unless tags = Also, I'm looking at slimserver/Slim/Control/Queries.pm Lines 460 to 473 in a1719ae
and slimserver/Slim/Control/Queries.pm Lines 866 to 877 in a1719ae
If the sort should always be using the What do you think? |
Oh... I thought you had introduced that one. But no, was me...
Except if some particular role has to be dealt with. Or if we want the full list of contributors, right? |
We'd still join to The lists of contributors/names are retrieved separately in Agreed? |
See #1205