Yannick's Corner

WordPress Plugins, Plugin Development Cookbook and random thoughts

Tune Library

Allow visitors to see a full listing of your entire iTunes music collection

This plugin import the music information from your iTunes Library into WordPress. Once imported, you can print the contents of your library to a WordPress page.

My Music section of this site uses Tune Library to generate its contents.

Donations

If you feel generous and really like this plugin, here is a donation link on Paypal:

PayPal-Donate-Button-PNG-HD

117 thoughts on “Tune Library

  1. Hi Yannick.
    I have downloaded and installed the iTunes WP Plugin, when I try top import the XML file the following error happens:
    Connecting to MySQL…Loading iTunes library file… (http://martinhomepage.com/wordpressBlog/wp-content/plugins/tune-library/iTunesMusicLibrary.xml)

    Warning: domdocument() expects at least 1 parameter, 0 given in /home/content/s/p/m/spmartin/html/wordpressBlog/wp-content/plugins/tune-library/tune-library.php on line 202

    Fatal error: Call to undefined function: load() in /home/content/s/p/m/spmartin/html/wordpressBlog/wp-content/plugins/tune-library/tune-library.php on line 203

    What have I done wrong?

    Regards

    Stephen Martin

    Like

    1. Sorry for the last of response. Easter week-end was quite busy for me. I will look into the issue tonight.

      One question, did you remove the spaces from the file name of your iTunes library? Have you already removed the file from the plugin folder? I tried to access it but could not.

      It almost sounds like the file was loaded on your FTP site but with an empty content.

      Yannick

      Like

  2. Could you possible send me your iTunes Library File so that I can try to load it? Just fill in the form in the Contact Me section and attach your file to it. While it will tell me what type of music you listen to, the XML file does not give me access to any other info about your system.

    Like

  3. I'm receiving these error messages:

    Connecting to MySQL…Loading iTunes library file…(etc/wp-content/plugins/tune-library/iTunes Music Library.xml)

    Warning: domdocument() expects at least 1 parameter, 0 given in etc/wp-content/plugins/tune-library/tune-library.php on line 202

    Fatal error: Call to undefined function: load() in etc/wp-content/plugins/tune-library/tune-library.php on line 203

    Like

  4. My apologies, Yannick, I truncated the full URL so as not to make public a directory structure which my hosting service uses, but which also reveals personal information. I shall send, via your CONTACT link, the full URL of the error messages, the URL in my WP config (different from the error message) and my iTunes XML file.

    Like

  5. Great plug-in, especially the last update that "dynamically" loads my (very large) iTunes Library. Only suggestion I have is, when selecting an Artist, for example, that has many "albums" underneath, when the list expands (drops down), it should really be indented hierarchically. That's it (unless you can make it actually **play** my iTunes tracks 🙂

    Like

    1. Actually, you can create some indentation between artists, albums and tracks by creating styles in your blog's stylesheet to create some margins. Here is a list of the styles that I created in my template to get the look on my music page:

      .ArtistHeader{
      padding-left:20px;
      margin: 6px 0px 6px 0px;
      }

      .AlbumTitle {
      padding-left: 20px;
      margin: 6px 0px 6px 0px;
      }

      .AlbumListHeader {
      padding-left: 20px;
      margin: 6px 10px 6px 10px;
      }

      .TrackList{
      padding-left: 20px;
      margin: 5px 0px 5px 0px;
      }

      Like

  6. I love your plugin! I had been wanting some way to share my music collection, a list of the collection anyway, online for a while now. Your plugin works great however I'm seeing a lot of albums with no tracks which I assume is a problem with my xml file. I'll investigate that and get it figured out.

    The other issue, one you might be able to help with, has to do with the size of my collection. I simply have too many songs to list them all at once. Not only does the page take an incredibly long time to load, it's much too long. I'm thinking we need some sort of pagination. Something like the pagination on Digg and Flickr, but letters rather than numbers, and on hover show how many artists there are for that letter. For letters that have no artists, the link should be disabled and greyed out.

    I'm thinking ajax would be slick for swapping in the artists as you click the various links, but due to the amount of data, that might not work so well. I guess just transferring the actual data in json format and then having JavaScript build the layout would work, but that seems overly complicated so I think having it swap pages would be the simpler way to go.

    Any thoughts on this? I know your collection is much smaller and looks real nice on a single page so you may not be interested in doing anything with pagination. I'm sure I'm not alone in needing this feature however.

    Either way, you have a great plugin!

    -Blimey

    Like

    1. Thanks for the feedback on Tune Library. The functionality that you are describing does sound like it would be quite useful to more than one Tune Library user. I will investigate how it could be implemented in the next week or two. I am not familiar with AJAX programming and have not even done a WordPress plugin that receives arguments yet, but I am always eager to learn something new. I will write updates as I investigate this.

      Like

  7. I am making some good progress at adding some alphabetical filtering for Tune Library. Stay tunes for an update later this week.

    Like

  8. Hello. Great work on making the ordering hierarchical. Question: on your music page, you, at first, only show a partial list of of your library, with a "show all" option. How do I configure tune-library to do this? Also, if I include any text on the page with the tune-library tag, it goes to the bottom of the generated list, even if I stick it before the tag, as in an headline.

    Like

    1. Hi Larry,

      All you need to do is to check the option "Filter artists by letter and show alphabetical navigation" and you will only see artists for one letter at a time. You can then check the Display "Show All" in Navigation Menu option to see Show All next to the list of letters to choose from.

      I saw the issue with the text appearing at the bottom no matter where you put the text but have not found a way to address this yet. I will post a new version as soon as I resolve this issue.

      Yannick

      Like

  9. Hi Larry,

    Version 1.4 should address the issue that you reported. The Tune Library output will now show up where the [tune-library] shortcode is placed on the page.

    Yannick

    Like

  10. I get an error message when I click on the Import iTunes Library link.

    Connecting to MySQL…Loading iTunes library file… (http://www.jason-saggers.com/wp-content/plugins/tune-library/iTunes Music Library.xml)

    Fatal error: Cannot instantiate non-existent class: domdocument in ****wp-contentplugins une-library une-library.php on line 208

    My xml file is around 9mb, would that be a problem?

    I also get this on the music page that I created.

    WordPress database error Table 'jason_wordpress.wp_tracks' doesn't exist for query SELECT min( substring( artist, 1, 1 ) ) as letter FROM wp_tracks where artist != '' made by require, require_once, include, the_content, apply_filters, call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, tune_library_func, tune_library WordPress database error Table 'jason_wordpress.wp_tracks' doesn't exist for query SELECT distinct artist, 'artist' as source FROM wp_tracks where artist != '' and artist like '%' order by artist made by require, require_once, include, the_content, apply_filters, call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, tune_library_func, tune_library

    Which I assume is because I haven't imported the xml file correctly.

    Like

    1. Hi Jason,

      I have imported a larger iTunes file successfully, so I don't think that it is the issue. Something that you might want to try is to remove the spaces in the file name and then trying to import it again.

      Let me know if you are still having problems after trying this.

      Yannick

      Like

  11. Hey,

    I've been attempting to get this plugin to work for a while now, had some issues due to PHP keeping it from working but managed to get that all figured out. However, now the plugin appears to 'work', and does nothing. When you upload the file:

    Connecting to MySQL…Loading iTunes library file… (http://blog.aethernavale.net/wp-content/plugins/tune-library/iTunesMusicLibrary.xml)
    …done

    Problem is, nothing has actually occurred. No new tables were added to the SQL databases. Any ideas on what could be causing that issue?

    Thanks~

    Like

    1. Michael,

      I am really puzzled about the fact that no messages were printed and no tables were created. Could you potentially send me your library file via XML?

      Yannick

      Like

  12. Hi Yannick,

    Great plugin! got it working with a test library export and it's really cool. But, came to load my full library and on import library, i get a 404 and only some of the tunes load, seems to do this when import takes a while (a timeout perhaps…?): is there a maximum size for libraries?

    Like

    1. I have not really experimented to find the maximum size, although I have loaded some libraries from a few users that were quite large. if you can share your library XML file with me, then I can try to load it on my test site.

      Like

  13. Hi Yannick,

    I had installed the iTunes plugin and could have swore that it was working properly, but now, it seems that whenever I click on a letter, it doesn't skip to that letter, instead it just appends a # at the end of the address. If I disable the AJAX function, I get a link to the letter, but when I click on artist names, it doesn't display the album list. I'd love to see if we can get this squared away as I absolutely LOVE your plugin and haven't found anything else that provides this type of functionality.

    Like

  14. Just a quick note, the plugin doesn't seem to recognize any music added to my library after upgrading to iTunes 9.0. i don't know if this is an issue with the plugin, or an issue in the way that the new version of itunes writes the xml. i tried uploading the xml file today, but see no new additions. hopefully this can be fixed as i love your plugin.

    Like

  15. Hi Rob,

    Thanks for the comment. I will investigate this issue in the coming week. I was busy working on a major update to one of my other plugins which I released yesterday.

    I will keep you posted.

    Like

  16. Hi Rob,

    I just tried importing my current iTunes library, which I updated and added items to using iTunes 9.0.1 and all items, old and new, showed up correctly after the import. Could you potentially send me a copy of your iTunes library XML file so I can try it out on my test server as well as inspect the contents to see if anything is different in the new entries. If the file is too large, I can give you access to my Dropbox.

    Yannick

    Like

  17. Yannick,

    I'll try to import it again and if that doesn't work I'll gladly send you my XML file. Although you'll need to give me your dropbox access as the xml is about 65megs…

    Like

    1. I just added you to a shared folder in my dropbox. Does that automatically send you an e-mail? I am fairly new to dropbox.

      Like

    1. Thanks Rob. Could you point out to me some of the items that you added since you upgraded to iTunes 9 and other items which were in your collection previously? This will help me in analysing what changed in the XML file.

      Like

      1. Hi Rob,

        I uploaded your XML file to my test server and imported your music collection. From looking at the results quickly, everything seems to have been uploaded, including the latest entries to the file that were dated from a few days ago. Can you take a look at the results and tell me if you see something specific that is missing?
        http://testsite.nayanna.biz/my-music/#

        Yannick

        Like

    1. Hmm… I wonder if you might have reached some sort of file size reading limit with your web host… Perhaps a test to try quickly would be, perhaps on another computer, to create a smaller library in iTunes 9 and see if that loads correctly or not.

      Like

  18. Yannick,

    Thanks for the suggestion. It appears that after changing the filesize limit in my php.ini to 128 from 64 all is once again right with the world. Thank you for your assistance and patience!

    Like

    1. I am glad to hear that my hunch on the file size was accurate. Thanks for letting me know of the fix. I am glad you had access to change this configuration on your server.

      Like

  19. Ok, so one more thing…

    If I enable the option "Use Album Artist instead of Artist when present"

    the # at the beginning of the nav, is no longer clickable.

    If i disable (uncheck) this option, it is clickable again…

    any ideas?

    Like

    1. That was a bug in the code. Since all of my tracks with artists with names not starting with a letter were part of compilations, I had not noticed that it never appeared. I just published a new version, 1.4.2, to address the issue. It should soon be available for download.

      Like

  20. That's an interesting thought, but not an easy one since I found the code to parse the iTunes library and save it in a database. I will do some research to see if I can find a parser for the WMP library and then see how much work it would be to add that feature.

    Like

    1. Hi Jason, Not a silly question at all. All my plugin does is to extract textual information about your music and store this text in your database. So it won't increase the size of your database that much. The increase in size is directly related to the size of your collection and the names of artists and tracks in your collection. So liking Rush more than Emerson, Lake and Palmer would use up less space 🙂

      Like

  21. I really like the idea. I got a problem though. I Inserted The code in quotations " [tune-library]" I tried removing and it still won't show up in the page. The source code for the page shows its there. I can see your page but not mine. I'm tested with both chrome and firefox. Latest versions of course.

    I also tested it with 5 other brand new themes. Not sure what the deal is but if you could help me out that wuld be great. I'm using the latest version of wordpress also.

    I do have a feature request. Pull xml file from a url on your host. Set intervals for it to update.

    Like

    1. Hi Andrew,

      The code not getting translated into the actual output usually just means that the plugin is not activated correctly or that the keyword has a typo it.

      Did you XML library's import work correctly into the plugin? If so, then things should display.

      If you want, you can create a temp admin account on your blog and I will connect remotely and double-check that everything is configured as needed for this to work.

      Like

  22. Yannick,

    It's not showing up in my page. I am using the latest wp install along with firefox and chrome. My library is quite large around 5500 songs. The source code for both firefox and chrome show the code for the library it just won't render it and show it. Any ideas what could be going wrong?

    Like

  23. I'm not to smart apparently. When I installed it I uploaded the XML file but when I unistalled it and then reinstalled it the XML wasn't picked up even though the directory hasn't changed.

    Like

    1. Hi Andrew,

      I am not sure I understand why you uninstalled the plugin and re-installed it. The plugin only read data from the XML file when you press the import button. Afterwards, the data is stored in your blog's MySql database and access from that repository.

      Like

  24. Yannick,

    Since it wasn't working the first time I thought that maybe it didn't get installed correctly.

    Not sure why it didn't pull data from the mysql database though. That's strange

    Like

  25. Hello Yannick,

    I have tried your plugin and I love it, if I was not constantly broke I would make a donation for it. I do have a question about it though. I have noticed that for some reason many of the entries are lacking information beyond the initial listing.. I was wondering what might cause that? could it be that the information the plugin seeks is simply not there for some reason? an example would be the 1980's collection I have it only lists the following:

    1980's Collection

    Hunting High and Low

    Sounds of the Eighties – 1980

    Sounds of the Eighties – 1981

    Sounds of the Eighties – 1982

    Sounds of the Eighties – 1988

    Sounds of the Eighties – The Early '80s: Take Two

    Sounds of the Eighties – The Early 80s – Take Two

    Sounds Of The Eighties – The Rolling Stone Collection (1986-1987)

    Sounds of the Eighties – The Rolling Stone Collection – 1980-1981

    Sounds of the Eighties – The Rolling Stone Collection – 1982-1983

    Sounds of the Eighties – The Rolling Stone Collection – 1983-1985

    Sounds of the Eighties – The Rolling Stone Collection – 1987-1988

    Sounds of the Eighties – TV Themes of the '80s

    Sounds of the Eighties- The Rolling Stone Collection – 1988-1989

    beyond that it displays nothing. I know the plugin is working because many of the other listings show the sing titles as it should. Any Idea's?

    Like

    1. Hi Shawn, Sorry for the late reply. I was travelling for work when you sent this question in and am still playing catch-up. I would have to look at your iTunes XML data to see why this problem is happening. Could you send it to me at ylefebvre "at" gmail.com?

      Like

  26. Hi Yannick,

    Great idea for a plugin. I'm relatively new to website creation, and I'm not sure exactly how to get this working. i downloaded, installed, and activated the plugin, but not sure where the code is to add it to a page, or what to do next. Might you be able to help walk me through it? I use WordPress, in case that matters. Thanks!

    Like

    1. Hi Jake,

      All you need to do to see the output is to create a WordPress page, then type the text [tune-library] in the page's main body text.

      Like

  27. Hi Jake, You upload your iTunes XML file to your web server in the tune-library server, then press the import button in the plugin's admin page.

    Like

  28. Sure I can send a copy over. I was thinking it might have to do with the really long names but it could be missing information for all I know. never thought to read the XML.. but I shall send it over. =) thanks for looking.

    Like

    1. Hi Shawn. Sorry about that. It seems I lost that mail in the shuffle as I was about to leave for a trip when it came in. I will try to get to this in the next day or two.

      Like

  29. Hi Yannick,

    Thanks for the info, I tried adding [tune-library] to the page, but it just comes out blank (http://stuchill.com/?page_id=345)

    The xml file imported with no problems and I can't see anything I have missed. Do you have any idea what it could be? Would love to get this plugin working, been looking for something similar for ages!

    Regards,

    Stuart

    Like

  30. I just checked the pages source code and here is the entry for tune-library:

    <!– Tune Library 1.4 Output –>

    var plusImg = new Image();

    plusImg.src = "http://stuchill.com/wp-content/plugins/tune-library//plusbl.gif&quot;

    var minusImg = new Image()

    minusImg.src = "http://stuchill.com/wp-content/plugins/tune-library//minusbl.gif&quot;

    function showAlbums() {

    if (document.getElementsByTagName)

    x = document.getElementsByTagName('div');

    else if (document.all)

    x = document.all.tags('div');

    for (var i=0;i<x.length;i++)

    {

    if (x[i].id.indexOf("Set") != -1) {

    x[i].style.display = "";

    }

    }

    if (document.getElementsByTagName)

    x = document.getElementsByTagName('img');

    else if (document.all)

    x = document.all.tags('img');

    for (var i=0;i<x.length;i++)

    {

    if (x[i].id.indexOf("Set") != -1) {

    x[i].src = minusImg.src;

    }

    }

    }

    function hideAlbums() {

    if (document.getElementsByTagName)

    x = document.getElementsByTagName('div');

    else if (document.all)

    x = document.all.tags('div');

    for (var i=0;i<x.length;i++)

    {

    if ((x[i].id.indexOf("Set") != -1) || (x[i].id.indexOf("Album") != -1)) {

    x[i].style.display = "none"

    }

    }

    if (document.getElementsByTagName)

    x = document.getElementsByTagName('img');

    else if (document.all)

    x = document.all.tags('img');

    for (var i=0;i<x.length;i++)

    {

    if ((x[i].id.indexOf("Set") != -1) || (x[i].id.indexOf("Album") != -1)) {

    x[i].src = plusImg.src;

    }

    }

    }

    function showLevel( _levelId, _imgId ) {

    var thisLevel = document.getElementById( _levelId );

    var thisImg = document.getElementById( _imgId );

    if ( thisLevel.style.display == "none") {

    thisLevel.style.display = "";

    thisImg.src = minusImg.src;

    }

    else {

    thisLevel.style.display = "none";

    thisImg.src = plusImg.src;

    }

    }

    function showArtistLetter ( _incomingletter) {

    var map = {letter : _incomingletter}

    jQuery('#contentLoading').toggle();jQuery.get('http://stuchill.com/wp-content/plugins/tune-library/tune-library-ajax.php&#039;, map, function(data){jQuery('#dhtmlgoodies_tree').replaceWith(data);initTree();jQuery('#contentLoading').toggle();});

    }

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: