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

Enthusiast I
February 5, 2010
DarrenLink,

With respect to the new format, I disagree. I would rather have the portable device loaders down convert the files on the fly. Overall, I think that this is a better solution because a new format would imply that all of the rippers and taggers would need to be updated -- again. True, there are probably as many rippers and taggers as there are downloaders, but the optimum download format for the portable is a moving target.

If there are multiple portable units in a household, possibly spanning multiple generations, a single embedded low resolution format is not appropriate either. New devices are sporting more memory and at some point I suspect that lossless downloads will be practical. If the device loader transcodes on the fly, the optimum format can be used for each device. True, the transcoding will require more processor power, but modern computers are so fast that this is not much of an issue.

Another aspect of embedded data is that anything touching the file will have to slog through at least one irrelevant copy of the music data. This will tend to clog the network FOR EVERY TRACK. Even simple tag editing will slow down. I would rather do some special handling every once in a while. I don't mind launching a process that might run for days.


Buzz,

I believe when synching to an iPod shuffle you could down convert tracks to a smaller format. I remember doing this for my iPod shuffle at the time and it was painfully slow for just 100 tracks. It takes my PC about 20 minutes to convert a single album from Apple Lossless to MP3 so it would take weeks to synchronise 10,000 odd tracks with a brand new iPod. I really can't see an on the fly down conversion being practicle for filling a 160 Gb empty iPod Classic with MP3's down converted from Apple Lossless on the fly. My 60 Gb ipod takes about 3 hours to populate fully from empty without doing any conversion. Perhaps I need a new computer but I can't see a new PC being any where near faster enough for this to be practicle.
Extracting a single file from a zip file is a very quick process in comparison to doing a down conversion from one format to another, and that is doing decompression. Without compression it should be practicle I would have thought.

New rippers will be required for the Music DNA format so that issue will need to be tackled at some point. I have no idea if that will take off or when however and have no idea about its spec.

Potable devices will continue to grow in capaciy but so will the demand to populate them with every increasing library sizes. From the following calculation I suspect we will need a 1 terrabyte portable device to be able to populate it with approximately 50,000 Apple Lossless files.

20 Mb approx per track x 50,000 tracks = 1,000,000 Mb = 1 terrabyte approx

According to amazon you can get 40,000 MP3's on a 160 Gb iPod classic but the number of Apple Lossless files would be far less.

My 250 Gb NAS is completely full and the majority of my my 10,000 track library is in Apple Lossless. At the moment I wouldn't be able to get all of the my Apple Lossless files on to a 160 Gb iPod. Capacity may well grow at a larger rate than my collection so maybe at some point in the near future I will be able to populate a portable device with my entire library of Apple Lossless tracks. That is something to look forward to.

If you have lossey and lossless files in separate files in different locations you are always going to need to maintain a relationship between the two files, just like my application currently does. If you can think of a better way of doing this in my appliation please let me know. I'm always open to new suggestions. At the moment I can easily alter the tags in my iTunes MP3 library but I don't have an efficient way of ensuring those changes are also applied to the Apple Lossless tracks. I therefore try to get my tagging perfect just after ripping and before generating the lossey copy.

Hi Darren
Thanks for your latest guidance, particularly on how to ensure that ITunes doesn't reorganise my carefully constructed file structure!


Best of luck with trying my app Jeremy. Any questions you have about configuring my application, let me know and I'll get back to you as soon as I can.

Regards

Darren
Contributor III
February 7, 2010
I suspect you do not have "Minimize to system tray on close" ticked under Edit->Settings. Darren
You are absolutely right Darren, apologies. I have now turned this option on
Gordon
Enthusiast I
February 8, 2010
You are absolutely right Darren, apologies. I have now turned this option on
Gordon


Thanks for confirming Gordon. It's good to know the cause of the behaviour that you were seeing with the system tray functionality.

I recommend that other users try the system tray functionality once they have set up the application to work with their setup. When enabling the system tray I suggest all of the system tray options are ticked within Edit->Settings

Regards

Darren
Enthusiast I
February 17, 2010
Hi,

I have posted version 2.70.0 tonight which fixes a minor bug within the "Non exact match found" dialog box. Ampersand (&) characters within file paths were previously not displayed.

This is likely to be my last update for a while as I am currently seeking alternative employment.

Please feel free to continue posting questions and comments and I will get back to you as soon as I can.

Regards

Darren
Prodigy I
February 18, 2010
... and thanks for your work on this so far. I am going to load it up later today, and don't foresee any problems.

All the best
Prodigy I
February 18, 2010
Hi Darren,

Seems I spoke too soon in my last post!

I have just installed v2.70.0 and have two problems:
1. The mapping transforms aren't working for me; and
2. the Library Manager has crashed several times.

In more detail:
1. I am 99% sure I have set up the transformations correctly, but when I process the rules, none of the destination files are found. I say I am 99% sure I have set up the tranformation rules correctly because of a test I did: I went to the csv file of unmapped files and copied one of the track paths into Windows Explorer address bar; I then manually edited the start of the path in identical fashion to the rule I had set up (replacing c:\My Music with s:\Music, and changing the file extension from .m4a (AAC) to .flac . Explorer found the correct lossless file, showing that the transformed path and filename were correct.

Of course, I could be missing something obvious, but I wondered if this might be a problem with the new v2.70?

2. On a number of occasions, the Library Manager has crashed at the end of processing the mapping rules. The program then won't run again until after a reboot. I couldn't detect any pattern to the crashes - sometimes all was OK, sometimes not, about 50:50. I have a screen shot of the error report if that is helpful to you (not sure how to send this to you though).

Sorry to bother you with this when no doubt you have more important things to do, but if you get bored of the job search and have a moment to reply with any suggestions, I'd be very grateful.

Thanks, Jeremy
Enthusiast I
February 19, 2010
Hi Jeremy,

Sorry to hear that you are having trouble. I have confirmed tonight that I haven't broken anything in my 2.70 release by deleting the mapping cache file and the non mapped tracks file from my PC. I then processed my configuration and the mapping cache file was completely rebuilt. If you make any substantial changes to your mapping rules I recommend deleting both the mapping cache file and the non mapped tracks file before reprocessing.

Please can you confirm that you have a single mapping rule defined with the following configuration:

Source Media Type: AAC Audio File (m4a)
Source Path Find: C:\My Music (check case)
Path Replace: S:\Music (check case)
Destination Media Type: FLAC - Free Lossless Audio Codec (flac)

I have just done a test on my PC and I suspect I know the cause of your issues with the mapping rules. If the drive letters are specified in lower case instead of upper case the rules fail. The find and replace operation on the paths is currently case sensitive. If the path of a track in iTunes begins with C:\My Music the find rule of c:\My Music will unfortunately fail. This is something I should probably address in a future release.

If this is the case with your setup I suspect you should be up and running very quickly by changing the drive letters to upper case. As an extra precaution make sure your S drive is succesfully mapped before processing. If the S drive becomes disconnected at the time of processing the mapping rules will fail as the program will not be able to find the tracks you have stored on your S drive.

The fact that the program crashes at the end of the processing suggests that it may be having difficulty saving the destination XML file to your NAS. Please confirm that your Destination Library path is either S:\iTunes Library.xml or S:\iTunes Music Library.xml and that you can create a test text file within S:\. Sonos will pick up the xml file with either of the two filenames. A screenshot showing the application and the error message at the time of the crash will be helpful. Plese move the error message so that it is not obscurring the configuration of the app. You will find my email address on my profile page on these forums. Please attach the screenshots to an email in PNG or JPG format to keep the email size low.

I hope all that helps. It sounds like I may need to do a few user useability tweaks and also improve the error handling. The feedback is very helpful for me improving the application.

Thanks for trying the application. It sounds like you are almost there!!!

One other thing that I should mention is that I have only tested the application with the Microsoft .Net Framework version 3.5. If you have a different version installed there could possibly be a compatibility issue.

I hope to here from you soon.

Regards

Darren
Prodigy I
February 23, 2010
Darren

Your advice worked a treat. I had the drive letters in lower case. I had also set up multiple rules, with the one you cited in your last post as the first one. I deleted them all and started again with just one rule, with the drive letters in upper case, and have had no problems since. I have also successfully added further rules since.

Since then, I have also only had one crash. Still can't tell what is causing it. The S: drive is permanently mounted, and the destination library path is as you describe. The fact that it is hit-and-miss suggests to me that there is could be a conflict with some other background software, perhaps? The other possiblility is that it is a timeout on writing the library file - my NAS has a disk spin-down feature which puts it in a lower power mode on idle. It takes about 10-20 seconds to spin back up if there has been no activity for a while. DOes this give you any clues?

I will try to email a screenshot of the error message.

Thanks again, from a happy user,

Jeremy
Enthusiast I
February 24, 2010
Jeremy,

It's good to hear that you have my application working. It may not be working with best performance however.

I have taken a look at the error message that you sent me. The error was a system.io.exception (Input/Output) at the time of "saving the track mapping data" (mapping cache file). This file by default is saved to the same location as the source iTunes Library.xml file (at C:\....\ My Music\iTunes (J+R)\iTunes Library - Track Mapping Data.csv in your case)

Please check to see if this file has been created and the modified time of this file? If the file has never been created, there will be no cache so subsequent runs will continue to be slow. With the cache file in place 10,000 tracks are processed in about 20 seconds on my PC instead of several minutes. This greatly improves the useability of the application.

I should add some error handing to the saving of all of the files. This would then give me, more details about the nature of the error. It could be a file permissions issue. Are you able to create a temporary text file within your iTunes folder and do you have plenty of free space on your C drive?.

Unless you also get errors when the status in the bottom left hand corner is "saving destination library" then there is not an issue saving to your NAS.

I tried creating a new version of my app where the find and replace rules ignored the case of the paths. This however greatly reduced the performance of the application. I may just add extra validation so that any absolute paths entered with incorrect case are adjusted upon saving the configuration.

Thanks and regards

Darren
Enthusiast I
February 28, 2010
Hi,

Tonight I have uploaded version 2.70.3 (http://www.darrenlink.talktalk.net/ituneslibrarymanager/download)

This version includes the following updates:

1) I have added error handling to the file saving routines. If any of the files fail to save you should now get a meaningful error instead of the application crashing.

2) I have ensured that all file paths are saved with the correct case. This includes any absolute paths specified for source path find or path replace. Remember that the find and replace functionalirty is case sensitive. If your music folder is called C:\Music and you enter c:\music within a find field it will be changed to C:\Music. The same is the case for the replace fields.

3) I have fixed an issue with the find best match functionality when running the transformation rules. The best match is found for the disk number and track number specified within the filename.

Regards

Darren