X  

Plugins Part II

Track/Directory import





 ☰  menu
To top
Released on 11 June 2018 RadioDJ v2.0.0.6
    DJ-JHONNY.NL || RADIODJ v.2+ TUTORIALS.

List of query's to use in rotations.

By beavis. Select track from playlist, enforcing artist and album repeat rules:
With this example you can choose a track from a playlist, rather than a category.
The advantage of selecting from playlists instead of categories is that a track can be placed in multiple playlists, whereas it can only be placed in a single category.

SELECT `songs`.`ID`, `songs`.`artist`, `songs`.`title` FROM `songs`
LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`)
LEFT JOIN `playlists_list` ON (`songs`.`ID` = `playlists_list`.`sID`)
WHERE `songs`.`enabled`=1
AND ((`start_date` <= Now()) AND (`end_date` >= NOW() OR `end_date` = '2002-01-01 00:00:01'))
AND (TIMESTAMPDIFF(MINUTE, `date_played`, NOW())>$TrackRepeatInterval$ AND TIMESTAMPDIFF(MINUTE, `artist_played`, NOW())>$ArtistRepeatInterval$)
AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL)
AND (`playlists_list`.`pID` = '4')
ORDER BY RAND() LIMIT 1;
In this example, `playlists_list`.`pID` = '4' specifies the ID of the playlist.
To find the ID of your chosen playlist look in the ID field in the playlists table of your database.
To top