X  

Plugins Part II

Track/Directory import

 ☰  menu
To top
DJ-JHONNY.NL || RADIODJ v.2+ TUTORIALS.

List of query's to use in rotations.

By Marius.
-- PLAY TWO TRACKS FROM THE SAME ARTIST AND EXCLUDE ARTISTS THAT ARE IN THE QUEUE
SELECT `ID`, `artist` FROM `songs` WHERE `artist`=(
SELECT `songs`.`artist` FROM `songs`
LEFT JOIN `queuelist` ON ( `songs`.`artist` = `queuelist`.`artist`)
WHERE `songs`.`enabled`=1
AND `songs`.`song_type`=0
AND ((`songs`.`start_date` <= Now()) AND (`songs`.`end_date` >= NOW() OR `songs`.`end_date` = '2002-01-01 00:00:01'))
AND ((TIMESTAMPDIFF(MINUTE, `songs`.`date_played`, NOW()) > $TrackRepeatInterval$) AND (TIMESTAMPDIFF(MINUTE, `songs`.`artist_played`, NOW()) > $ArtistRepeatInterval$))
AND  `queuelist`.`artist` IS NULL
GROUP BY `songs`.`artist`
HAVING COUNT(*) > 1
ORDER BY `songs`.`date_played` ASC LIMIT 1)
AND `enabled`=1
AND `song_type`=0
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$))
ORDER BY `date_played` ASC
LIMIT 2;
$SweeperOnStart$

-- ADD 10 MOST PLAYED TRACKS TO THE PLAYLIST
SELECT `ID` FROM `songs` WHERE `song_type`=0 AND `enabled`=1 ORDER BY `count_played` DESC LIMIT 10;

-- ADD 10 TRACKS OF AN ARTIST TO THE PLAYLIST
SELECT `ID` FROM `songs` WHERE `artist`='term' LIMIT 10;

-- term = actual artist name (eg. 'Prince').
-- For any other number of tracks, you can change LIMIT 10 to other value, eg. LIMIT 5.
-- Note: The term must be preserved in single quotation mark and its not case sensitive.

-- ADD 3 TRACKS WITH SWEEPER FROM 1970 TO 1989
SELECT ID, year, path FROM songs WHERE $ForceRepeatRules$ AND year >='1970' and year < '1990' ORDER BY rand() LIMIT 3;
$SweeperOnStart$

-- ADD ALL TRACKS FROM A SPECIFIC ALBUM TO THE PLAYLIST
-- term = actual album name (eg. 'Diamonds And Pearls').
-- Note: The term must be preserved in single quotation mark and its not case sensitive.
SELECT `ID` FROM `songs` WHERE `album`='term' ORDER BY `track_no` ASC;
To top