Commit 67559044 authored by Jonas Haraldsson's avatar Jonas Haraldsson

bugfix: tag radio only play loved tracks

Swapped sql queries for globaltags/$tag and globaltags/$tag/loved
parent b5e64dba
......@@ -93,10 +93,10 @@ function make_playlist($session, $old_format = false) {
if (preg_match('@l(ast|ibre)fm://globaltags/(.*)/loved@', $url, $regs)) {
$tag = $regs[2];
$res = $adodb->CacheGetAll(7200, 'SELECT Track.name, Track.artist_name, Track.album_name, Track.duration, Track.streamurl FROM Track INNER JOIN Tags ON Track.name=Tags.track AND Track.artist_name=Tags.artist WHERE streamable=1 AND lower(tag) = lower(' . $adodb->qstr($tag) . ')');
$res = $adodb->CacheGetAll(7200, 'SELECT Track.name, Track.artist_name, Track.album_name, Track.duration, Track.streamurl FROM Track INNER JOIN Tags ON Track.name=Tags.track AND Track.artist_name=Tags.artist INNER JOIN Loved_Tracks ON Track.artist_name=Loved_Tracks.artist AND Track.name=Loved_Tracks.track WHERE streamable=1 AND lower(tag) = lower(' . $adodb->qstr($tag) . ')');
} else if (preg_match('@l(ast|ibre)fm://globaltags/(.*)@', $url, $regs)) {
$tag = $regs[2];
$res = $adodb->CacheGetAll(7200, 'SELECT Track.name, Track.artist_name, Track.album_name, Track.duration, Track.streamurl FROM Track INNER JOIN Tags ON Track.name=Tags.track AND Track.artist_name=Tags.artist INNER JOIN Loved_Tracks ON Track.artist_name=Loved_Tracks.artist AND Track.name=Loved_Tracks.track WHERE streamable=1 AND lower(tag) = lower(' . $adodb->qstr($tag) . ')');
$res = $adodb->CacheGetAll(7200, 'SELECT Track.name, Track.artist_name, Track.album_name, Track.duration, Track.streamurl FROM Track INNER JOIN Tags ON Track.name=Tags.track AND Track.artist_name=Tags.artist WHERE streamable=1 AND lower(tag) = lower(' . $adodb->qstr($tag) . ')');
} else if (preg_match('@l(ast|ibre)fm://artist/(.*)/similarartists@', $url, $regs)) {
try {
$artist = new Artist($regs[2]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment