Library tools for RadioDJ

RadioDJ Library Tools plugin provides an overview of available tracks in each category and is intended as a guide for building rotations and troubleshooting track quantity issues.

The plugin started as an SQL query for RadioDJ library overview. It all began on this RadioDJ forum thread.
After initial release *life happened* and I completely neglected plugin development. I realised that that original forum thread is the only place this plugin was published. Many RadioDJ users may be completely oblivious to plugin’s existence so I’m posting it here.

RadioDJ Library Tools 1.0
RadioDJ Library Tools 1.0

Version 1.0
Initial release

ENHANCEMENT: Option to enter a minimum number of tracks.
ENHANCEMENT: Added keyboard shortcuts for refreshing the table (F5 or Ctrl+R)
ENHANCEMENT: Option to view SQL script used by the plugin in Help > The SQL
ENHANCEMENT: Option to save selected cells in table to CSV or HTML file

ENHANCEMENT: Added second tab to view data for genres. Grouping by subcategory is done using DataGridViewGrouper and that’s why rendering is slow. I may remove the grouping if there are enough complaints.

Version 2016-06-27 @ 23:44 GMT
BUGFIX: Exception is thrown when RadioDJ is closing
BUGFIX: Exception is thrown when collapsing groups in genres grid
ENHANCEMENT: Low track count highlighting in genres grid

Grab it here:

I hope that some of you will find the plugin useful.


Folder Loader plugin for RadioDJ

This is my first RadioDJ plugin and also happens to be my first C# project.

There is a dedicated topic on forums which contains detailed changelog and may be more up to date than this post.

The idea came about after reading a post by PHAZE FM on RadioDJ forums. He needed to clear a category and then import all files from a directory into that category. Unfortunately, RadioDJ does not have that kind of functionality. That is until I decided to create a RadioDJ plugin which can do exactly that.

Folder Loader plugin adds two event actions for use in scheduled events:

  1. Clear Subcategory – deletes songs from a subcategory specified by category and subcategory name or ID as argument. It will delete song records from database, so it’s up to you to decide if it suits your needs.
  2. Load Files From Folder – imports all supported file formats from a directory, placing them in a subcategory, assigning genre and track type specified by name or ID as arguments.

Example action for importing tracks from “C:News” into main category “News”, subcategory “Latest News”,  assign “News” genre and set type to “News”:

PluginAction|Folder Loader|Load Files From Folder|C:News;cat=News&subcat=Latest News&genre=News&type=News

There is just one option – Recurse subfolders. It directs the plugin to scan for files in all subdirectories of specified directory.


If genre is set to AutoGenre, plugin will try to read genre from ID3 tags. This may slow down import process.
Cue point data can be imported from file ID3 tags (if saved previously) using ID3cue=yes.
Do not add the ID3cue parameter, since plugin checks for its presence, not its value. Reading cue data from ID3 tags may slow down the import process.
e.g. to import tracks with cue points and genres from ID3 tags, action would be

PluginAction|Folder Loader|Load Files From Folder|C:News;cat=News&subcat=Latest News&type=News&genre=AutoGenre&ID3cue=yes

Get it here: Plugin_FolderLoader

To start using it, unzip downloaded file to Plugins directory and restart RadioDJ.


Migrate SAM Broadcaster data to RadioDJ

As expected, I’m getting sick of all the bugs in SAM Broadcaster and lack of support from Spacial. I’ve decidet to swith Radio H2O to RadioDJ The idea had been on my mind for some time, but after reading a RadioDJ forum post by NounosSon I decided to start working on it. After all – how hard can it be; It is only data after all.

This solution generates a valid MySQL SQL script from SAMBC Firebird or MySQL database if WORK_MODE in config.php is set to WORK_MODE_FILE or inserts data from SAMBC database directly into RDJ MySQL database if WORK_MODE is set to WORK_MODE_INSERT. In latter case you have to make sure the database and its tables exist. I highly suggest to try WORK_MODE_FILE first, so you don’t mess up you RDJ database. While exporting data it is possible to convert between character sets if SAM_CHARSET and TARGET_CHARSET are set to correct values.

Note: Charset conversion can be disable by setting SAM_CHARSET and CHARESET to same value.

To run the script, shut down SAMBC. You can even completely uninstall SAMBC, because all we need is the data from database and your data belongs to you, not Spacial.

If you use direct import option – WORK_MODE_INSERT, you have to shut down RadioDJ and please back up your data.

Version 0.1

Exports only historylist data from SAMBC. Few fields are missing from resulting data:

  1. id_subcat (sub category reference);
  2. disk_no (no disc numbers in SAMDB);
  3. original_artist;
  4. copyright;

I had to fiddle a bit with genre data, but got it working after all. If the genre from SAMBC songlist matches a genre in RDJ genre table the matching genre_id will be exported. Comparison is done case-insensitive, so it should be ok if case is different from song to song.

Imortant! Make sure you’ve set RDJ “Keep History For” under “Stream Titles” settings tab to a higher value before starting migration, otherwise the history data will be lost on next RDJ startup.

Version 0.2

Can export historylist and songlist data from SAMBC. For now song data will be exported without category data. The problem is that RadioDJ does not have multilevel categories like SAMBC does. I had a conversation with Marius about this and he promised to look if and how he could implement that in RDJ. All SAMBC xfade settings will be translated to RDJ cue_times, but all songs will have to be placed in correct subcategories.


  • Esport SAMBC categories as RadioDJ playlists. If only RDJ rotations allowed to select songs from playlists, I’d be ready to migrate.
  • Create RDJ MySQL tables if needed
  • Check songlist entries for moved/removed files before import

The source is available on GitHub.


SAM Broadcaster Firebird to MySQL migration

While managing SAM Broadcaster for Radio H2O I got sick of all the bugs and charset incompatibilities between filesystem and Firebird DB dealing with other SAMBC quirks. So, I decided to migrate SAMBC data from FirebirdSQL to MySQL to see if it could help.  In short; it didn’t solve main problem, because SAMBC messes up everything by using Windows default code page for its internal workings. Never the less, it was a nice exercise in coding for two databases and charset conversion.

The script requires a recent PHP version and PDO extension. It can be run from CLI as well as web script in Apache.

Fork or download it from GitHub.