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

Lyricist I
March 8, 2010
I would like to play directly from iTunes to a Sonos player. Does anyone know if there is a plugin, or something like that, for iTunes available. (I have tried already to work with the Sonos Queue Tool from SteveEisner. This gives me only errors.
Avid Contributor I
March 10, 2010
I think this is a bit off topic so perhaps a mod could move it, but the answer that seems bulky but would work immediately would be to audio line output from the computer you are using itunes on into an audio input on any sonos player. Then any 1 or more of your sonos players (that one or others) can access the line input as the audio source and play whatever it is you are commanding itunes to play.

I do have to ask though, why? is it mainly because you like the interface better on itunes than whatever sonos controller you are using? or an actual feature? I ask because I used itunes a ton before but just import everything into sonos now, even my itunes smart playlists.
Enthusiast I
April 7, 2010
Hi,

It's been a while since I last posted but tonight I have produced a guide for structuring both lossey and lossless music for use with my app.

The guide is at:
http://www.darrenlink.talktalk.net/ituneslibrarymanager/tutorials/MusicStructureGuide.pdf

I have made a few changes recently to the application itself but unfortunately I have not had the time to fully complete all changes and to fully test them. Many apologies to those waiting for a promised update.

Darren
Lyricist I
August 31, 2010
Hi Darren,

I have a problem that seems to be fixable with your ingenious software. After some initial trial and (mostly) error I 'm not sure I do things correctly and I'm therefore asking for some help.

My setup is similar to your setup with two separate places for storing my music files. The original music files (mp3) and the iTunes library are place on my laptop and a copy of these is placed on my NAS. I have not gone through the effort to make lossless copies yet so for the moment I just want to have my zoneplayer (ZP90) to use the music files and playlist in the iTune Library.xml mirrored on my NAS.

The only hiccup is that my laptop is a Mac and I can therefore not run your software on it. I do however have a PC at home as well so I thought I could simply copy the MacBook iTunes Library.xml on to my PC and run it through your software.

Since I only want to import into the ZP some of the iTunes playlist I only select the source library (the iTunes Library.xml now placed on my PC) and the iTunes Library.xml place on my NAS (viewable to the ZP). I then click the radio button "Choose playlists to include in output file" and tick the box "Choose playlists upon processing" and select the playlists I want converted.

In my overly optimistic mind I thought that the paths to the files in the selected playlists would be exchanged by the new path on my NAs regardless of the initial path but there seems to be more to it than that and obviously the output was not what I suspected (i.e nil).

Is there any way I could do it differently and make it work with my pc-mac-nas setup?

Even if I have not yet made it work myself I thank you for making this software which must save a lot of people so much time, sweet and pain.

Cheers,
Claes
Enthusiast I
September 17, 2010
Claes,

When you run my application under Windows it will need to produce paths that are accesible from Windows.

You have stated that your test MP3 on your nas is at the following location (from your MAC)

Volumes/media/Musik/CDs/test_song.mp3

but windows will not be able to locate the track at this path.

Can you access your test mp3 using the following path (where nasdevicename is the device name of your nas)?

\\nasdevicename\media\Musik\CDs\test_song.mp3

If so you may have success using the following rules:

search: Users\macpro\Music
replace with: \\nasdevicename\media\Musik

If this doesn't work, I'll take a look at my code to identify the problem.

My music is on a Z drive on my windows PC so my rules are simply:

search: Z:\Music
replace with: \\nas\sonos\Music

Notice that backslashes (\) are used in my rules but the path that is written within the XML file will have forwardslahes (/)

Darren
Enthusiast I
September 20, 2010
gblasius,

Unfortunately my apllication is currently only compatible with Windows. I have done some inital research into creating a Mac version but it would be very difficult to develop as I do not have a Mac myself.

Regarding your other question, I have created a feature in my app that will attempt to match filenames if the source and destination filenames begin with the track number followed by a space and there are subsequent differences in the filenames.

Let me explain...

Say you have a local file called
Z:\Music\Darren\Artists\Beatles, The\Albums\Revolver\03 I'm Only Sleeping.mp3
but the high quality version on the nas was named:
\\nas\sonos\Music\Darren\Artists\Beatles, The\Albums\Revolver\03 Im Only Sleeping.m4a (without the quote in I'm) ...my application would suggest that the two files were the same track and will give you the option of renaming the destination track so that's it's filename (minus the extension) matches the source filename. Alternatively you can choose not to rename the destination track and match the two files anyway. Once the files are matched and are in the track mapping cache file you will not to re-map the two tracks again. If the source and destination filenames are identical after ignoring the extensions, the tracks will me mapped automatically without any prompts.

If you have a destination track that is located on your nas in a completely different directory structure to the source file you could always add an entry to the track mapping data manually. The track mapping data is simply a csv file that can be manually edited. For simplicity however I'd recommend keeping your directory structure the same wherever possible.

Unfortunately if the low quality and high quality version of a track have tagging differences, my application will not spot this and will not alter the tags. Other than promting where necessary to rename files, my program does not modify your audio files. I generate my MP3's from the Apple Lossless version after perfecting my tagging so that both copies have identical tagging information.

Darren
Contributor III
September 20, 2010
I believe my file names begin thus (04)TRACKNAME.FLAC.

Where the track number is in parens....however, there are probably some which use spaces as a delineator, and some which use hyphens!

don't know if your program would recognize these, but as a suggestion, perhaps you could give the user the chance to name the template (ala Exact Audio Copy).

Regarding 1 - I have a windows emulator, so perhaps your application would work...but to be sure - what is an file with extension .msi?

Really appreciate your help, this is exactly what I need (I hope)!!
Enthusiast I
September 20, 2010
Gblasius,

The msi file is a Windows installation file. Ultimately it extracts to an exe file that has been compiled using the Microsoft .Net 2.0 framework. It was written in C# using Visual Studio 2008.

I'll have a think about your other suggestion. With your naming convention the program would work (at least under windows) but any filenames that are not an exact match would need to be manually renamed. Any tracks in your source library where a destination equivalent cannot be found are written to the non mapped tracks report. It would be useful to improve the auto-mapping feature when the filenames are not an exact match. Thanks for your thoughts.

Darren
Contributor I
May 2, 2011
Darren, just wanted to say I've come across your program for the first time, as I've hit the limit of 40,000 tracks in iTunes Playlists on the Sonos system (lots of nested Playlist folders and I don't want to restructure them!) A quick Google search and I was led here... I've successfully used your application to cherry-pick the playlists I want and that is working great, so thanks, you solved my problem!

I tried to play around a bit with the transformation rules, specifically I put in transforms just for one sub folder, as I wanted to test. I ended up getting nothing in my playlists except tracks listed in my transformation, so looks like its all or nothing?! I also have a suggestion if you are still developing this program, don't know if its easy or not: When you deselect the "Define transformation rules" box, it would be useful if it doesn't remove all the existing rules, but rather was a toggle on/off button within the code itself - that would make it easier to test without having to re-define the rules each time...

My big issue (not for you to solve!) is that I currently store all my music on my PC, mostly in MP3 but I've started re-ripping in FLAC - with 400+ CDs, its going to take a while! Its under ..\Music\MP3 and ..\Music\FLAC I then mirror everything to my NAS drive for the Sonos controller to pick up. This also functions as a useful backup location just in case... I edit the Tags so the FLAC albums have a leading < character in the Albumname. Then I get both showing seperately in Sonos. The way your transform rules work, I will have to change my folder structure so that I have a folder for "Highest quality" stuff (lossless & lossy where there is no lossless equivalent) and one for MP3s only. Then the HQ stuff will get backed up to the Sonos share and the LQ stuff will have to get backed up to another non-Sonos share. Would really like to create a ..\Music\LQ and ..\Music\HQ folder structure but don't fancy updating 10K+ tracks in iTunes! Ughh.... I really need to plan this!

Anyway, I hope your situation is better than last time you posted, thanks again and good luck!
-Durwin
Enthusiast I
May 4, 2011
Durwin,

Many thanks for providing feedback for my application. Below are my responses

just wanted to say I've come across your program for the first time, as I've hit the limit of 40,000 tracks in iTunes Playlists on the Sonos system (lots of nested Playlist folders and I don't want to restructure them!) A quick Google search and I was led here... I've successfully used your application to cherry-pick the playlists I want and that is working great, so thanks, you solved my problem!

That's great news. I'm glad this part of the application solved your playlists problem. Nested playlists (i.e. playlists in folders) really eat into the Sonos memory, especially if Smart Playlists are used. I like having the flexibility so that only my favorite/most used playlists are imported into my Sonos system. I have a lot of unused playlists in my iTunes library that I really should delete but don't want to as I spent ages creating them all!!!


I tried to play around a bit with the transformation rules, specifically I put in transforms just for one sub folder, as I wanted to test. I ended up getting nothing in my playlists except tracks listed in my transformation, so looks like its all or nothing?!


You are correct. The application is designed to transform all paths in your iTunes library that are not indexed by Sonos to paths that are indexed by Sonos. In my setup my last rule is a catch all rule that transforms MP3's in Z:\Music (local PC drive) to MP3's in S:\Music (Sonos share \\nas\sonos mapped as a network drive [S:\]). For each track the first rule that finds an alternative equivalent is used. If none of the rules are able to find an alternative, the path is changed to something like 'track not found' (i.e. an invalid path)


I also have a suggestion if you are still developing this program, don't know if its easy or not: When you deselect the "Define transformation rules" box, it would be useful if it doesn't remove all the existing rules, but rather was a toggle on/off button within the code itself - that would make it easier to test without having to re-define the rules each time...


I understand your issue but there is an existing alternative for testing different configurations. The application supports multiple iTunes libraries so you can have a different configuration for each library for your household. For testing you can create a test configuration by going to Library -> Add New iTunes Library. This will create an additional configuration tab and you can specify the same source Library as in your original configuration. Use the first tab for your playlist cherry-picking configuration and use the second tab for your test configuration. You can give each configuration/tab a description. I'd prefer to keep the interface the way it is as I feel it's good that the whole transformation rules section is not visible for users who do not require them. It's quite an advanced feature that takes some getting used to, and not everyone wishes to use it or see it. I would probably implement your request if I had the time but unfortunately work is very busy at the moment!!!


My big issue (not for you to solve!) is that I currently store all my music on my PC, mostly in MP3 but I've started re-ripping in FLAC - with 400+ CDs, its going to take a while! Its under ..\Music\MP3 and ..\Music\FLAC I then mirror everything to my NAS drive for the Sonos controller to pick up. This also functions as a useful backup location just in case... I edit the Tags so the FLAC albums have a leading < character in the Albumname. Then I get both showing seperately in Sonos. The way your transform rules work, I will have to change my folder structure so that I have a folder for "Highest quality" stuff (lossless & lossy where there is no lossless equivalent) and one for MP3s only. Then the HQ stuff will get backed up to the Sonos share and the LQ stuff will have to get backed up to another non-Sonos share. Would really like to create a ..\Music\LQ and ..\Music\HQ folder structure but don't fancy updating 10K+ tracks in iTunes! Ughh.... I really need to plan this!
-Durwin


For simplicity and backup purposes, I would like to have complete local MP3 and lossless folders that are both mirrored to my NAS and indexed by Sonos. Unfortunately if you have the same track in both formats the Sonos indexer will pick up both files and you will end up with duplicates in your Sonos library. I therefore maintain my Sonos share manually (rather than mirroring) so that it only contains the highest quality version of each track. For backup purposes I regularly mirror both my local setup and my nas Sonos share to a backup drive that is not indexed by Sonos.

As I have recently upgraded my 250 Gb NAS to a 2Tb one I may use your suggestion going forward and mirror everything from my local drive to my NAS. (i.e. complete MP3 folder, and folder containing just the highest quality version of each track). Your post has certainly given me some food for thought.

If you have C:\Music at the moment for your MP3's and your iTunes library uses all of these you could do the following:

1) Copy C:\Music to C:\Music (LQ)
2) Create a new configuration in my app to replace C:\Music with C:\Music (LQ) for all tracks and generate a new iTunes.xml file locally
3) Create a new empty iTunes library (hold shift key down as you double click on iTunes and keep it held down until you get the option to create a new library). Then import the generated iTunes.xml that points to your tracks in C:\Music (LQ)
4) Scrap your original iTunes library, but only once your are fully happy!!!!! Be very careful!!!
5) Rename C:\Music to C:\Music (HQ)
6) Gradually replace the MP3's within C:\Music (HQ) with their FLAC equivalents as you rip them
7) Mirror both folders to separate shares on your NAS (perhaps with Robocopy) but only index the HQ share.

I hope the above suggestion helps.

Regards

Darren