Loading...
 

iTunes Update

iTunes Update is something that came to me while trying to import songs from my daughters iTunes account. I run Windows XP with multiple user accounts; my daughter has her own and I have mine. We both have separate iTunes libraries and separate iPods. I like some of the music that she purchases. Since the music is on the same computer it is also "authorized" for use in both accounts. The problem comes up when I try to import her newly purchased songs. There is no good way to do this automatically without creating duplicates. I've resorted to "finding" her files by date in Explorer and then importing them one at a time into my iTunes. One time I tried adding her directory as another folder but this duplicated all of her music that I had previously imported.

Well it turns out that Apple released a COM module for manipulating iTunes an the library. I would like to write a short app. to browse and selectively import while excluding duplicates. It's a "future" project but I have started some of the research below.
  • Potential Process
    • Configure and store a list of directory paths to monitor
    • Note if user wants to copy or simply reference the existing media for each directory path
    • Store a list of songs that have been previously "seen" for each path
    • Each time the script is run create a new play list and insert all of the new (i.e. "unseen") items
    • User can then use iTunes and the new play list to decide to keep or delete new material
    • User should remove each item from the play list after deciding to keep an item

A second similar use case that I discovered as to do with moving music files to a new location. I currently have a lot of music that I ripped from my CDs outside of iTunes. This is stored on a PC and the drive is shared out. iTunes is run on a different PC where we have 4 separate libraries for separate users. We all import from the common CD Archive library. I now want to move the library to a new computer because that one is 10 years old. If I just outright move it then we must manually update the location for every song. If I "consolidate" in each user's iTunes library then multiple copies are made invalidating the whole purpose of a common library. Solution, copy all the CD Archive library to the new computer then iterate over every item in each person's library updating the path to the new computer. Would be great if iTunes supported this, maybe the COM interface has functions that will permit updating the file paths?

A third use would be to "consolidate" from just one path. Currently iTunes supports the "consolidate" feature that will create copies in the local library for any non-local files. In my case I have three non-local sources; my daughters iTunes library; my son's iTunes library; and the shared mp3 library. I don't want to consolidate from the shared library, but I do want to consolidate from the kids' libraries.

Commercial Applications

TuneRanger - $30

Script References

Doug's Windows Solutions - List of lists for windows implementations
Teridon's iTunes Scripts - Perl iTunes COM
Nate's Scripts for iTunes for Windows - JavaScript based scripts
iTunes Javascripts

iTunes Location Update

I wrote a quick, one afternoon, script that satisfies the second and third uses above. The script will allow a user to move or copy tracks between file paths updating the iTunes track location. This is especially handy for users that have imported external libraries into their iTunes library but later want to move those files to a new location without using the "consolidate" function in iTunes.

The script can filter the list of files to move to those whose file path matches a user-supplied pattern (regex). Each unique track location path is printed and the user then may select one of the unique paths to move. Unique paths are any paths that are different from more than the last 2 subdirectories. This may not work for all sources since it assumes the file structure resembles artist / album / song.

The script is based on original work of Robert Jacobson and is released under the GPL v2 license.

Download it here:
itunes_update_location.pl

Contributors to this page: michael .
Page last modified on Monday 20 of July, 2009 07:08:35 CDT by michael.

Attached files

ID Name Comment Uploaded Size Downloads
21 itunes_update_location.pl michael Mon 20 of Jul, 2009 07:07 CDT 8.04 Kb 2577