Skip to main content
Enthusiast I
July 6, 2009

iTunes Library Manager

For Sonos users who wish to choose which of their iTunes playlists are transferred to Sonos or for users who wish to use lossy formats for their ipods and lossless for their Sonos system. It makes a custom XML file on the NAS with unselected playlists removed and/or references adjusted to the lossless files. If you wish to only transfer a subset of playlists the application can be configured to display a playlist selector before the custom XML file is generated. The application can be configured to run and create the custom XML file on your NAS each time iTunes is closed.

http://www.darrenlink.talktalk.net/ituneslibrarymanager

http://www.darrenlink.talktalk.net/ituneslibrarymanager/download

I have written an application that solves two main issues for Sonos and iTunes users. Many people like to use iTunes to catalog their MP3 collection for use with iPods but prefer to store lossless files (perhaps apple lossless) on their NAS for use with Sonos. The "iTunes Music Library.xml" cannot be simply placed on the NAS as all the tracks are pointing to the lower bitrate MP3 files. Also many iTunes users have too many playlists to be imported into the available Sonos memory. (Especially if lots of smart playlists covering your entire library are defined)

My application solves the above two problems by changing the paths of the MP3's (or other lossey file types) within the "iTunes Music Library.xml" to the equivalent paths of the lossless files. It also allows the user to choose which playlists they wish to be imported into their Sonos system from their iTunes library. It also eliminates the need to maintain two separate iTunes libraries (although you are still required to create lossey and lossless copies of each track)

The application caches (and maintains) a one to one mapping between each file in iTunes with the equivalent higher quality file on your NAS. This caching allows the application to run through approximately 10,000 tracks on my PC and write an alternative xml file to my NAS pointing to the lossless files within about 25 seconds.

The application is completely configurable so it can be configured to match your setup.

More information, screenshots and the download link are above.
This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

111 replies

Avid Contributor I
December 22, 2009
Darren:

Will you be posting the updated version and, if yes, then when as I am in the same boat as many (dBpoweramp for ripping, manual importing) and the use of the updated version of your application/tool would be most helpful.

Thanks so much.

Joel
Enthusiast I
December 23, 2009
Joel,

I have tomorrow afternoon off work for Christmas Eve, so after I've finished wrapping all the presents I intend to post the latest version of the application on my web site. The version on my web site is quite old now. The latest version has been tidied up quite considerably, has an option so that the program can kick in and transform your library file as soon as iTunes is closed and the ability to analyse your iTunes library XML files for stats and broken links.

I am off work until the 4th January so I'm hoping to do further developments during this time. Feedback and suggestions for improvements would be useful. I should be around a fair bit over Christmas so feel free to catch me on MSN for a chat about the app. (My MSN address is on my Sonos forums profile page as previously mentioned)

Darren
Avid Contributor I
December 24, 2009
Joel,

I have tomorrow afternoon off work for Christmas Eve, so after I've finished wrapping all the presents I intend to post the latest version of the application on my web site. The version on my web site is quite old now. The latest version has been tidied up quite considerably, has an option so that the program can kick in and transform your library file as soon as iTunes is closed and the ability to analyse your iTunes library XML files for stats and broken links.

I am off work until the 4th January so I'm hoping to do further developments during this time. Feedback and suggestions for improvements would be useful. I should be around a fair bit over Christmas so feel free to catch me on MSN for a chat about the app. (My MSN address is on my Sonos forums profile page as previously mentioned)

Darren


Darren:

Fantastic news noting that I look forward to trying / using the new version...the one problem that I did have with the old version was that at random times -- and I could never figure this out -- it doubled the albums in iTunes meaning that as a backup I was always made a copy of the iTunes library before running the applications...that said, perhaps making a default copy before running it would be a beneficial safety feature...any thoughts?

Thanks,

Joel
Enthusiast I
December 24, 2009
Joel,

As promised the latest version of the application (version 2.55.0) is now up on my download page at http://www.darrenlink.talktalk.net/ituneslibrarymanager/download

This version is a substantially tidied up version from the one previously posted (version 2.29.0)

I hadn't realised that you or anyone else had tried using the earlier versions of the app. I'm not sure about the doubling up issue that you reported. Are you ensuring that only one copy of each track for each album exists within your master (lossey) library and that only the lossless copies of each track are within your share indexed by Sonos? Also make sure that only the destination "iTunes Music Library.xml" file is stored within your Sonos share.

After you have extracted the new version of the application and run it for the first time, it will detect that there are no iTunes libraries defined and it will ask you if you wish to define one. Answer Yes and a new unsaved configuration called "New Configuration 1" will be created. I rename the configuration to "Sonos Transformation". Select your source "iTunes Library.xml" stored on your local drive that points to your lossey files and then choose the path to the destination xml file on your NAS. The transformation rules are now optional and you have more control over what playlists are included in the destination library file that is written to your NAS. A new feature also allows you to clear user related data in your library such as play counts and track ratings. This feature is useful if you want to copy your entire library to a partners PC and wish to clear the user based data so that they can start with a fresh library. The destination XML file can be imported into an empty iTunes library to create a full "iTunes Library.itl" file.

Under Edit setting you now have the option to minimize the application to the system tray at startup and to listen for the closure of iTunes. When listening for the closure of iTunes, notifcation messages will be displayed about the current status of the application and iTunes but these notification messages can be surpressed within the settings. It is best not to enable the system tray and iTunes listening functionality until you are happy with your configuration.

I won't be around tomorrow and boxing day but if you have any issues I'll aim to respond on Sunday. If you continue to have your earlier issue I will do my best to help you sort that out. If you have MSN we can chat online to work through your issues.

I recommend using the analyse library function for your destination library to check that all of your tracks are pointing to the lossless files. Also check the contents of the "Mapping Cache File" to see the one-to-one mappings between your lossey and lossless files. The Non Mapped tracks file is useful to find any source files where an equivalent destination file has not been found as a result of the transformation rules that you have defined.

I hope you enjoy the latest version of the app.

Have a great Christmas

Darren
Contributor III
December 25, 2009
Darren - thanks very much for your hard work on this app. I still must download it, but I very much look forward to trying it out, as I am also off work for the next 10 days or so!
Enthusiast I
December 28, 2009
It's 4am here in the UK and I have just updated my website (http://www.darrenlink.talktalk.net/ituneslibrarymanager) with the latest version of my app (2.57.0). I have also updated the screenshots of the application (running under Windows 7 instead of XP) and have added details about the minimize to system tray and listen for closure of iTunes functionality. All the latest developments have been done under Windows 7 but hopefully the application will continue to run as expected under Windows XP.

I am keen to hear feedback from the Sonos community about the application so that I can continue to provide improvements. Enhancement requests will also be welcomed.

Users who do not wish to use the transformation feature for transforming lossey paths (e.g mp3's) to lossless paths (e.g to Appless Lossless or FLAC) can still benefit from my application. If your library consists of MP3's for example, these files as well as the iTunes library files can now be stored on your PC (instead of just being on your NAS). You can mirror the audio files to your NAS using an application such as robocopy and you will gain performance benefits when synching your ipod as well as having a backup of your MP3's (in case of PC or NAS failure). Having your audio files on your PC as well as your NAS is much better for laptop users as you will have access to all of your music within iTunes when you are away from home and you don't have access to your NAS. All of my MP3's on my PC are also mirrored to my girlfriends laptop using robocopy and she also has a copy of my entire iTunes library. I used my application to remove Rating and track play details from a destination "iTunes Library.xml" file and then imported this file into an empty iTunes library on my girlfriends laptop. Before doing this I ensured that all the files were in exactly the same location as on my PC (Z:\Music) so that the import of the XML file would succeed. With the ratings and play count information removed on her PC she is now able to create smart playlist based on her own track ratings and play information (play count, last played etc). She also has my "iTunes Library Manager" application running in the background on her PC and any playlists that she creates within her iTunes (or on her iPod touch) can also be imported into our Sonos system. On her laptop the configuration simply writes the destination "iTunes Library.xml" file to a different share on our NAS (\\nas\sonos_charlotte\iTunes Library.xml) but the file points to the lossless tracks under our \\nas\sonos share. The sonos indexer will quite happily import iTunes playlists from more than one "iTunes Library.xml" file. The setup is great as we both have our own iPods and have different tastes in music. Her 5 star tracks are completely different from my 5 star tracks and yet we can both have smart playlists based upon track ratings within our Sonos system. We are both starting playlist descriptions with our own name so that we can easily find our own playlists within Sonos. (Playlists from both our PC's are merged together under imported playlists within Sonos).

Please continue to note that this application is in no way supported or endorsed by Sonos themselves, and I cannot accept liability for any loss of data as a result of incorrectly restructuring your music. If you are in any way unsure how to move or restructure your files then please request assistance from myself or the sonos community. Unless you are %100 sure of what you are doing please ensure that you take a backup of all of your music and library files before making any strctural changes etc. For those users who store their MP3's and iTunes library solely on their NAS, a tutorial on moving the MP3's and library files to your local PC's is likely to be beneficial. (This is somthing that I can offer guidance on and may write a future tutorial on, if there is enough demand for one)

Joe and Bhsbum: Many thanks for your interest in my application so far. If you would like guidance on how to get the application working for your music collection, please let me know how your music is currently organised. I recommend getting the application working for a single "Album" before reorganising all of your music. Create a playlist for that single album and see how you can select that playlist from within my app.

Have fun with the app, but please ask if anything is unclear and take backups before making any changes.

Darren
Enthusiast I
December 30, 2009
I have just posted version 2.58 (http://www.darrenlink.talktalk.net/ituneslibrarymanager/download/2.58.0/iTunesLibraryManager.zip) which has the ability to kick off the Sonos indexer once the destination "iTunes Library.xml" file has been written to your NAS. By default this Sonos functionality is turned off, but once it is enabled (Under Edit Settings) and the application has been restarted you will see an additional option under each iTunes library configuration tab to start the Sonos indexer once the destination "iTunes Library.xml" has been written.

Credit goes out to Steve Eisner, whose C# code I have adapted to kick off the Sonos indexer. Once the Sonos functionality is enabled the number of detected Zones will be shown in the bottom left hand corner of the application. If no Sonos zones are detected the application will fail to kick off the Sonos indexer. (You will need to allow Windows to connect to your network for it to detect your Zone Players) There is an additional button to kick off the Sonos indexer whenever you wish. This button is disabled until at least one Sonos zone is detected.

I have noticed that after kicking off the Sonos indexer via my app, the desktop controller does not show that the system is busy indexing the music. The original wireless controllers (CR 100) show that the system is indexing after a short delay.

Feedback on the reliability of the Sonos indexer will be greatly appreciated. Under development tonight I noticed on occasions that the application failed to detect all my Zones but I have not experienced this problem with the release version that I have posted.

I hope you like the update. Any questions or problems please ask and I will do my best to help.

Regards

Darren
Contributor III
December 30, 2009
Hi Darren,
Many many thanks for writing this application I think it is very close to solving my SONOS library problems, but there is one additional feature that would be very useful to me.

Some background ...

I have all my music on a NAS share within the following folder
//NAS/Media/Music/MP3
//NAS/Media/Music/FLAC

I have all FLAC tracks duplicated in the MP3 sub folder for my iPod. However I also have other MP3 only tracks that I don't have FLACS.
If I point SONOS at my Media share on the NAS (using SMB) it picks up FLACs and MP3s and I end up with duplicates in my library

In Windows 7 explorer the //NAS/Media folder is mapped to M: drive, so in my iTunes.xml file everything points to //localhost/M:\Music\MP3

I can change this to //localhost/M:\Music\FLAC using your application BUT for those files that are not available in FLAC it replaces the record with 'record not found' - I would like it to continue to point to the MP3 file so that SONOS can use the FLAC files when available and if there are none it uses the MP3 files. Is this possible?

Also is there a particular reason why the output iTunes.xml file has to be on the NAS. Can I not just put this in a new folder on my PC and point the SONOS library to this bearing in mind that this new file is pointing to my M:\Music\FLAC (and hopefully M:\Music\MP3) files

Regards
Gordon
Enthusiast I
December 31, 2009
Gordon,

If you are indexing your //NAS/Media share and you have a track in both MP3 and FLAC formats (in the MP3 and FLAC subdirectories) the Sonos indexer will pick up both files resulting in duplicates within Sonos. This will be the case no matter what "iTunes Library.xml" file is found and indexed. This is because the "iTunes Library.xml" is used to import playlists, rather than to control which tracks are indexed by the Sonos indexer.

For this reason I keep all of my lossey tracks (mainly MP3's) on my local PC and my lossless tracks (Apple Lossless) on my NAS. I have many tracks that I only have a lossey copy of and these are stored both on my local PC and on my NAS (keeping the folder structures the same). I always ensure that I only have the highest quality version of each tracK within my NAS share that is indexed by Sonos (and no other lower quality versions of the same track available to the Sonos indexer)

Here is what I recommend (but please read and fully understand before you do anything)

If you are confident that all of your tracks within iTunes point to M:\Music\MP3 (where M is mapped to \\NAS\Media) you could copy your NAS MP3 folder (//NAS/Media/Music/MP3) to a local folder such as C:\Local Media\Music\MP3 and then make C:\Local Media a share on your PC. This share could then be mapped as an M network drive on your local PC (instead of pointing to your NAS). The paths to all of your MP3's within iTunes will not need updating but they will be pointing to your local PC instead of your NAS. After doing this you would be able to remove any MP3's from //NAS/Media/Music/MP3 that are also available in FLAC format under //NAS/Media/Music/FLAC. (i.e remove the lower quality duplicates from the share indexed by Sonos)

If you have multiple transformation rules within your configuration it will attempt each rule in turn until it finds a destination track to point to. If all rules are applied and no equivalent track is found then the application changes the path within the XML file to "No equivalent found"

In your scenario I would set up the following transformation rules

Rule 1
~~~~~~
Souce Media Type: MPEG Audio File (mp3)
Source Path Find: M:\Music
Path Replace: \\NAS\Media\Music
Destination Media Type: FLAC - Free Lossles Audio Codec (flac)

Rule 2 (If the equivalent FLAC file is not found via Rule 1 this rule will be used to find the MP3 on your NAS)
~~~~~~
Souce Media Type: MPEG Audio File (mp3)
Source Path Find: M:\Music
Path Replace: \\NAS\Media\Music
Destination Media Type: MPEG Audio File (mp3)

If you change the rules I recommend deleting the "Mapping Cache File" and my program will recreate it from the new rules.

Finally your last question. The "iTunes Library.xml" file can be on any share that is indexed by Sonos but you must remember that the share that it is stored on must be available when you re-index Sonos. I therefore think that the best place for your "iTunes Library.xml" is on your NAS. The Sonos indexer will import multiple "iTunes Library.xml" files. These can be stored in the same share, or they can be in different shares. In your scenario I would set the Destination Library Path to: \\nas\Media\iTunes\Gordon\iTunes Library.xml or \\nas\Media\Music\iTunes\Gordon\iTunes Library.xml depending on your preference). If another nember of your family wishes to have the MP3's on their laptop or PC they could be mirrored from your local PC to their laptop retaining the same M:\Music access that iTunes is using to find the MP3's on your PC. If the paths to the MP3's are the same on a second PC, you can simply copy the 'Source Library' iTunes Library.xml file that is generated from iTunes to the secondary PC and then import this file into a blank iTunes library. Also if you wish, you could use my program to generate a modified copy of your "iTunes Library.xml" file that doesn't contain any playlists or user related data such a ratings and play counts. This is what I did for my girlfriends laptop where my local MP3's are mirrored to.

I know that the above trick of creating a 'Music/Media Partition' share and mapping it as a network drive on the same PC works. I have this setup on my PC to save re-partitioning my drive and assigning a drive letter to the physical partition that my Music is stored on. In the past I had a Z drive physical partition for storing all of my music (Z:\Music) but when I got a new hard drive I did not want to restrict the size of the partition for my Music so I used the share/mapped network drive trick so that I would not need to repoint iTunes to a different drive and location. I don't think there is any performance limitation in doing this as the network drive is pointing to the same PC (anyone, please correct me if I am wrong)

I have probably given you more info than you need, but if you have any questions please ask before you make any changes to your current setup. It is always best to be 100% sure before you make any changes. It is not straightforward maintaining lossy and lossless copies of each track but I hope my application makes the process easier. If you have lots of playlists you should find the feature for limiting which playlists are written to the Destination Library XML file useful. Also after you have done any restruturing you can use the "Analyse Library" feature to check that there are no broken links to any tracks. You can use the "Analyse Library" feature on any source or destination library XML file, or you can specify a different "iTunes Library.xml" file altogether via "Library -> Analyse iTunes Library XML file".

If you have a laptop it makes sense to store your MP3's and iTunes library files on that laptop so that the library and music can be used on your travels. Any playlists that you make on your travels can be imported into your Sonos system on your return, but they will be pointing to the lossless equivalents (for each track where a lossless copy is available).

Any questions, please ask. I understand that my application is not the easiest thing to understand.

Darren
Avid Contributor I
January 1, 2010

Joel,

As promised the latest version of the application (version 2.55.0) is now up on my download page at http://www.darrenlink.talktalk.net/ituneslibrarymanager/download

This version is a substantially tidied up version from the one previously posted (version 2.29.0)


Although I have just returned from a short trip overseas I have downloaded the now latest and greatest version (2.58) and will give it a go the next time that I have a CR rip...should, knowing me, be over the weekend.

Appreciate you doing the work and getting this out.



[QUOTE=DarrenLink;93134]
I hadn't realised that you or anyone else had tried using the earlier versions of the app. I'm not sure about the doubling up issue that you reported. Are you ensuring that only one copy of each track for each album exists within your master (lossey) library and that only the lossless copies of each track are within your share indexed by Sonos? Also make sure that only the destination "iTunes Music Library.xml" file is stored within your Sonos share.
[\Quote]

As far as the doubling up goes please note:

1. All my lossless files and all my compressed files are stored on my NAS drive BUT under two different shares (i.e. one share is called AppleLossless, the other share is called MP3).

2. I am certain that only one lossless track exists for each album, that only one lossless track appears in the SONOS library, etc.


3. Perhaps to be clearer I was using iTLU separately for the lossless and lossy libraries. That is:

a) I would rip the CD in AppleLossless to the AppleLossless share drive using dBpoweramp.

b) I would convert the AppleLoss files to the MP3 files on the MP3 share drive using dBpoweramp's batch converter

c) I would then use iTLU separately on each share to add the files to the iTune library but, in each of the shares, the files would be doubled (i.e. not physically doubled on the drive but doubled within iTunes because the resulting iTL after running the application listed each file/song twice).

d) Thus, I stopped using the application but am very happy to give the new version a go...I will simply make a copy of my iTL before running it.



[QUOTE=DarrenLink;93134]
After you have extracted the new version of the application and run it for the first time, it will detect that there are no iTunes libraries defined and it will ask you if you wish to define one. Answer Yes and a new unsaved configuration called "New Configuration 1" will be created. I rename the configuration to "Sonos Transformation". Select your source "iTunes Library.xml" stored on your local drive that points to your lossey files and then choose the path to the destination xml file on your NAS. The transformation rules are now optional and you have more control over what playlists are included in the destination library file that is written to your NAS. A new feature also allows you to clear user related data in your library such as play counts and track ratings. This feature is useful if you want to copy your entire library to a partners PC and wish to clear the user based data so that they can start with a fresh library. The destination XML file can be imported into an empty iTunes library to create a full "iTunes Library.itl" file.
[\Quote]

Not usre I understand the above bit regarding but will play with things when I give it a go...really, at least for now, most interested in using iTLU to:

a) Add lossless songs to my lossless iTunes library that have been ripped by dBpoweramp

b) After a) above automatically i) convert the above added songs to lossy formats and ii) add said songs to my lossy iTune library...a *HUGE* added bonus would be the ability to carry over ratings in the conversion process from lossless to lossy.

c) After a) above automatically re-index my SONOS library




Under Edit setting you now have the option to minimize the application to the system tray at startup and to listen for the closure of iTunes. When listening for the closure of iTunes, notifcation messages will be displayed about the current status of the application and iTunes but these notification messages can be surpressed within the settings. It is best not to enable the system tray and iTunes listening functionality until you are happy with your configuration.


Got it...sounds (pun intended) good!




I won't be around tomorrow and boxing day but if you have any issues I'll aim to respond on Sunday. If you continue to have your earlier issue I will do my best to help you sort that out. If you have MSN we can chat online to work through your issues.

I recommend using the analyse library function for your destination library to check that all of your tracks are pointing to the lossless files. Also check the contents of the "Mapping Cache File" to see the one-to-one mappings between your lossey and lossless files. The Non Mapped tracks file is useful to find any source files where an equivalent destination file has not been found as a result of the transformation rules that you have defined.

I hope you enjoy the latest version of the app.

Have a great Christmas

Darren


Again, much thanks...hope you had a Merry Christmas and a good satrt to the new year...will connect with you over the next few days when I have a new CD to rip and have used the latest version...

Joel