SQL Playlist Creation

Afternoon All
I'm using 6.1.1 and trying to create a playlist using SQL. It works BUT i end up with a load of tracks which i think are the actual directories with no duration listed and it also doesn't take into account the duration i'm setting in the statement
any advice?
I'm using 6.1.1 and trying to create a playlist using SQL. It works BUT i end up with a load of tracks which i think are the actual directories with no duration listed and it also doesn't take into account the duration i'm setting in the statement
- Code: Select all
DELETE FROM playlist_file WHERE PLAYLIST_ID = 11;
INSERT INTO playlist_file (MEDIA_FILE_ID, PLAYLIST_ID)
SELECT ID, '11'
FROM media_file
WHERE GENRE = 'Rap'
Or GENRE = 'Hip-Hop'
AND duration_seconds between '120' and '420'
And Type != 'DIRECTORY'
ORDER BY duration_seconds
LIMIT 1000;
SELECT COUNT(*) FROM playlist_file WHERE PLAYLIST_ID=11;
any advice?