XSPF.PHP Changelog & To Do list

NAV:

Current Changelog:


TOP
Last updated: December 26th 2009

See Readme for latest details.



12/26/09
Patched for php 5.3
An updated xspf.php for version 0.13 can be retrieved from here:
http://www.trbailey.net/xspf/xspf-5-3.phps

An updated xspf.php for version 0.14 can be retrieved from here:
http://www.trbailey.net/xspf/xspf-014-5.3.phps


Fixes "eregi Depricated" warning.

To Apply:
Rename your existing version xspf.php to xspf5.2.php
Click the appropriate link for your version above.
Copy and paste the contents as xspf.php to your favorite word processor.
Upload new xspf.php to your web server.

09/04/2009

SQL Injection WARNING.
In the readme is states you can use an existing database for playlist caching. While this is still true, do not use a database containing existing sensitive information or you might be open to an SQL injection attack. While the xspf.php program does not accept any input from the user making an sql attack very unlikely the id3 library does accept input. I haven't heard of any id3 SQL vulnerabilities but it's better to be safe than sorry, especially if you've spent time hardening your system against such attacks.

05/01/2009
Announcing version 0.14 via SVN only. This is an update that allows you to use the file url for an info link so users can download music with the normal info link click method.

**This version changes the format of the xspf.dir file. In previous versions a space was used to separate items on each line. This version uses a "," {comma} to separate items enabling the use of server directory names containing spaces.

**This version adds a new variable to xspf.settings.php to enable or disable the use of file url as info link.

**XSPF.autogen.php has been updated to generate a CSV (comma separated value) auto.xspf.dir file.

See readme link above and/or the latest original.xspf.settings.php from the svn package. The SVN URL is at the bottom of this page.

04/10/2009, added a page on protecting your music with .htacess to site
May 1st, added info link toggle for either xspf.dir info url or download link for file.
Changed xspf.dir format, items are now separated by a "," (comma) not a space. This will allow directory name with spaces in the next version.
Updated html stylesheet to inclcue title element for each track, changed formatting a bit so it's faster and looks better.
Committed latest changes to SVN.

04/09/2009, added a logo my son made for me. Thanks Ethan!

04/02/2009
!Bug: Known to effect WAMPServer 2.0 and possibly other windows servers:
Symtpom: Undefined offset: 2 shows at top of playlist.
The playlist will still work in the player but it tosses an error in the browser due to a php warning.
You can download the full corrected source xspf.phps and original.xspf.settings.php,
OR make a minor correction to the code. Use notepad2, wordpad or notepad++.

To update to the latest version, download and save xspf.phps as xspf.php, overwriting the existing file.
Download original.xspf.settings.php, transfer your existing options to this file and save it as xspf.settings.php
OR
To make the minor corrections:
Find the text below (apr line 106) in xspf.php.
$infouri = trim($DE[2]);

Change it to:
$infouri = @trim($DE[2]);




NOTE: it's come to my attention that the name "-noimage.jpg" causes issues in linux bash, especially when trying to delete or rename the file. Once I get a web installer working the name will be changed to just "noimage.jpg". I need an installation script that can rename all occurrences of -noimage.jpg and for it to be successful I need an installer and updater. I'm working on it.

If you've tried the package and found it to be lacking due to album artwork not extracted, check back next month. I'm adding a utility that will search the internet and locate album art. It will also attempt to download and update any album artwork based on the file name and track title. This utility will also resize the cover image as "noimage.jpg", saving it to the music directory. Net result will be that once you install the package you'll see images for any mp3 files containing usable artwork or at least a more pleasant default noimage.jpg, perhaps a large musical note.

Version 0.13 released March 30th 2009.

3/30/09
XSPF.AUTOGEN.PHP
Fixed incorrect output.
Autogen now saves output as xspf.dir, overwriting current xspf.dir
Autogen now requires timer.class.php included in latest release or on my source page.
See http://www.trbailey.net/xspf/advanced.html for direct source download.


PLAYER.PHP custom URL mode
Updated player.php so you can specify any url pointer to player.swf and skins.swf directory
Updated player.php so you can specify any playlist url, even a static playlist.

3/29/09
UPDATE for xspf.autogen.php
It has come to my attention that a recent .svn update to autogen is messed up.
It generates incorrect output, duplicating lines for directories. See above.

3/27/09
Update, xspf.autogen.php now only includes directories containing mp3 files.
Rejection array updated to ignore .svn directories if they exist.

3/26/09
Added support for gif, jpg or png images in music directory
Added test for gif, jpg or png as default playlist image.
If no -noimage.xxx is found, no image element for playlist is generated

March 2009
Added line feed and comma after artist (creator element) in annotation tag
Added publisher data to end of annotation and support for publisher url as a test.
If publisher URL shows up in any or your playlists let me know. It's documented but I haven't seen it used.

March 2009
Added custom URI for both info and link elements.
Link element is added via xspf.settings.php
info element is added to end of xspf.dir entry.
Example:
----[path]---------- ----[url]-------------------------- ----[info link]---------------
/var/www/xspf/music/ http://www.trbailey.net/xspf/music/ http://www.trbailey.net/music/

Updated output to format raw xml so it's nicer to read, thanks to comments from Sebastian at spiff.
This is an experimental update so it's not committed to svn yet.
Source is here: http://www.trbailey.net/xspf/xspf.phps
If you're not familiar with source output hit CTRL-A then
copy / paste it to notepad2 or Notepad++ and save as xspf.php
Fixes raw formatting issue with simplexml output (no newline after elements)


Added xspf.autogen.php to svn. (rev >35) Thanks to comments by tracy

xspf.autogen.php is a simple script that lists directories recursively,
generating a usable xspf.dir as output in a browser.
Get it here or update to latest svn.

Added example quick change player theme to index page.
Added example of using multiple playlists with a drop down list to index page.

Usage:
Copy xspf.autogen.php to your music directory containing subdirectories
Run it from a browser (http://yourhost/xspf/xspf.autogen.php
Copy output to xspf.dir and remove undesired lines.
Rearrange directory names the way you want them to appear in the playlist.
Save xspf.dir and regenrate playlist. (Shift+RELOAD in most browsers)

Known issues:
Some mp3 files don't cache correctly even on apparently correct tags.
Use get_id3() demo editor to read and write the tag.



New Features:
  Added support for Mysql cacheing
  Moved user settings to xspf.settings.php
  Added variable toggles for:
  MySql database cacheing
  xspf output in browser (via xsl stylesheet)
  Annotation element in output
  Comments in output
  Link & info element in playist (adds a download button in JW Player)
  Debug output forces browser stylesheet and displays server path's.
 
  Added string sort on full filename within in each directory. (see $sort in
xspf.settings.php)
   See SVN for latest updates

Comments to siggma@trbailey.net

SVN Instructions:
Assuming you know what svn is and it's installed on your box, the command below will work in a
linux/unix shell.

#svn co https://xspfphp.svn.sourceforge.net/svnroot/xspfphp

Once the SVN checkout is complete the current release will be located under: ./xspfphp. You can
then edit xspf.settings.php, create an xspf.dir file and upload all files to your web server for
testing. See readme.html or README in the installation for detailed instructions.
Please don't forget to upload your music



If you use tortoise svn, right click and enter the URL listed below and the name of the
directory in which to place the svn copy.

https://xspfphp.svn.sourceforge.net/svnroot/xspfphp




Current TODO:


TOP
Ok, I have a working sort and nobody compalined so that's that for now.

NOTE: it's come to my attention that the name "-noimage.jpg" causes issues in linux bash, especially when trying to delete the file. Once I get a web installer working the name will be changed to just "noimage.jpg". Apoligies.

Album artwork extraction is soon to be a reality. I was thinking there was some secret code to the album artwork name. Apparently there is not. The artwork extraction will initially be a a separate utility that creates the directory named "album_art" in each music directory, then traverses all music files in a folder and extracts album art for each track if it's not already there. The file name will be the same as the mp3 file.

If "album_art" already exists and any files exist with names that end in front.jpg, back.jpg, small.jpg, thumb.jpg etc. it will be found by the playlist and used.

[randomstring}.large.gif|jpg|png
{randomstring}.small.gif|jpg|png
{randomstring}.back.gif|jpg|png
{randomstring}.front.gif|jpg|png

If none of them exist, the utility will choose small, front, back or large, probaby in that order, as the default artwork. To keep playlist generation snappy I'll make a copy of the chosen image and reduce it to 150px square then copy it to noimage.jpg in the music root. I'll add a config option to make it larger if you want but 40K+ is a large image for a playlist decoration. I'm hoping to keep them less than or equal to 20K if possible. I suggest you think about using a tool like Irfanview, imagemagick, netpbm or one of the other tools available to optimize the image (reduce the palette) so it's efficient to download. Remember you're bandwidth will be greately effected by the size of these images on a busy site.

If you are reading this and have experience extracting artwork, please share it.
siggma at trbailey.net