Playing with Jinzora

June 16th, 2007 by papillon

After a couple of hours of organizing my 25 mp3 clips, and ripping some CDs, it occured to me that it would be nice to also add internet radio stations to the mix, integrated into Jinzora.

Basically, this is supported, but it does not work out of the box. You can add a dummy structure to your music collection (i.e. empty folders on your hard disk), and then add so called “link tracks” to that structure (mine looks like Internet Radio – Pop Radio – Various – Radio 1,2,3… and so on), but Jinzora begins to act up when you do this.

After a couple of hours of debugging, I found the root of the problem. Before the change, using the function “add link track” resulted in a PHP error in jukebox.php, and clicking on the newly created link resulted in a playlist that contains all files from the entire collection, which is of course not desireable.

1) Change frontend/blocks/jukebox.php around line 323 like this:

if (is_object($parent)) {
    $artist = ucwords($parent->getName());
}
 

Web streams seem to have no parent, so we need to check for a valid object before trying to get the name.

2) In popup.php around line 4646, after

if (isset($_POST['edit_taddress'])) {
 $path = array();
 $path[] = $_POST['edit_tname'];

add:

$path['filename'] = $_POST['edit_tname'];

This effectively adds the link’s name to the two database entries that are generated for a link, i.e. in the tables jz_nodes and jz_tracks, the name is added to the path column. Without the name, Jinzora generates non-unique entries and then simply adds ‘/’ to the playlist, meaning the whole collection…

I don’t really know PHP, I just seem to stumble upon it once in a while, so take this with a grain of salt. Nevertheless, this works fine for me.