I think I may have finally fixed this bug in 7.5-embedded, please try it
out and let me know! One thing to note is that these 2 queries don't
produce the same results, so it actually had another bug. The old query
returned artists who appeared on compilation albums only, due to the way
the joins were constructed. The new query only returns artists who have
non-compilation albums, which is what we want. This is the same result
set the web UI/player UI display and I don't think anyone has ever
complained about that.
Code:
--------------------
Old:
SELECT contributors.id, contributors.name, contributors.namesort,
contributors.musicmagic_mixable
FROM contributors
JOIN contributor_track ON contributor_track.contributor =
contributors.id
JOIN genre_track ON genre_track.track = contributor_track.track
JOIN contributor_album ON contributor_album.contributor =
contributors.id
JOIN albums ON contributor_album.album = albums.id
WHERE genre_track.genre = $genre_id AND contributor_track.role IN (1,5)
AND (albums.compilation IS NULL OR albums.compilation = 0)
GROUP BY contributors.id
ORDER BY contributors.namesort
New:
SELECT contributors.id, contributors.name, contributors.namesort,
contributors.musicmagic_mixable
FROM contributors
JOIN contributor_track ON contributor_track.contributor =
contributors.id
JOIN tracks ON tracks.id = contributor_track.track
JOIN genre_track ON genre_track.track = tracks.id
JOIN albums ON albums.id = tracks.album
WHERE genre_track.genre = $genre_id AND contributor_track.role IN (1,5)
AND (albums.compilation IS NULL OR albums.compilation = 0)
GROUP BY contributors.id
ORDER BY contributors.namesort
--------------------
--
andyg
------------------------------------------------------------------------
andyg's Profile: http://forums.slimdevices.com/member.php?userid=3292
View this thread: http://forums.slimdevices.com/showthread.php?t=53033
_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta