Re-enabling disabled tracks from certain categories in the background

I’d run across an issue in my setup where I would occasionally have a huge chunk of my catalog end up disabled, and wanted to find a quicker and easier way of re-enabling said tracks without using RadioDJ’s Track Manager; today, I finally sat down and did it.

Basically, what would happen would be some sort of interruption in the connection between the PC hosting all of my media and the PC running RadioDJ. When an interruption like that happens–say, from a kid turning off the machine–RadioDJ automatically disables the tracks, as they’re not available. To fix, one simply goes back into the database and re-enables said tracks. This task can be very daunting if performed through the Track Manager… so, SQL commands to the rescue!

In my particular setup, RadioDJ’s automated rotations pull primarily from three sub-categories: Regular Play, Limited Play, and After 10PM. Your install will of course vary, as this is just personal preference stuff. After poking around in the database, I found the IDs for those sub-categories, and constructed a simple update query:

update `songs` set enabled=1 where enabled=0 and id_subcat in (30,57,46);

…and to make the process a little more automated, I created a startup event for RadioDJ to process a batch file containing that command. Basically, the batch contains:

c:\xampp\mysql\bin\mysql.exe -e "UPDATE `songs` SET enabled=1 WHERE enabled=0 AND id_subcat IN (30,57,46);" --user=MYSQL_USERNAME --password=MYSQL_PASSWORD radiodj161

I may rethink the process at a later date and set a timed event to perform this operation, or write a php file for me to invoke an update on the fly if/when I put my operation into “production”…

One thought on “Re-enabling disabled tracks from certain categories in the background”

Leave a Reply

Your email address will not be published. Required fields are marked *