<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: Programmatic iTunes library mods</title>
      <link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods/</link>
      <description>Comments on Ask MetaFilter post Programmatic iTunes library mods</description>
	  	  <pubDate>Sat, 04 Feb 2006 13:06:58 -0800</pubDate>
      <lastBuildDate>Sat, 04 Feb 2006 13:06:58 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Programmatic iTunes library mods</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods</link>	
  	<description>I&apos;m looking for some kind of library for reading and writing from the &lt;em&gt;iTunes&lt;/em&gt; database. &lt;br /&gt;&lt;br /&gt; I emphasize that because I&apos;m not interested in dealing with the iPod, except in the sense that I want to have a setup similar to that described &lt;a href=&quot;http://ask.metafilter.com/mefi/32031&quot;&gt;in this thread&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
My issue is similar to this poster&apos;s.  I will have the vast bulk of my music on an NFS share on my old machine, with some subset on the new hotness of my Macbook Pro.  Since I&apos;m reasonably competent at the coding thing, but less competent at the reverse engineering thing, I want to make use of someone else&apos;s invention of the wheel.&lt;br&gt;
&lt;br&gt;
Broadly speaking, I want to maintain two libraries for iTunes, one of which that includes the files on both my MacBook and my NFS share, and one of which that includes only those on the macbook.  Further, I want to be able to synchronize them when I change states from connected to unconnected and vice versa.  The last thing I want to do is have some kind of easy (in the sense that &lt;em&gt;mv $folder $newfolder &amp;amp;&amp;amp; update_lib_locations $oldfolder $newfolder&lt;/em&gt; is easy.  I&apos;m not looking for AI, here) way of moving files between underlying stores.&lt;br&gt;
&lt;br&gt;
So, to sum up:  &lt;br&gt;
&lt;ol&gt;&lt;br&gt;
&lt;li&gt;I want to provide the illusion of one single library, that gains and loses songs depending on my connected storage devices.&lt;/li&gt;&lt;br&gt;
&lt;li&gt;I expect to have to write this myself.&lt;/li&gt;&lt;br&gt;
&lt;li&gt;I&apos;m totally new to the Mac&lt;/li&gt;&lt;br&gt;
&lt;li&gt;I want a freakin&apos; pony!&lt;/li&gt;&lt;br&gt;
&lt;/ol&gt;&lt;br&gt;
&lt;br&gt;
An equally good answer would be step by step instructions on setting up the same idea.  The solution I linked to above isn&apos;t good enough because it involves too many manual steps.  Less mousing == goodness.&lt;br&gt;
&lt;br&gt;
Thanks.</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.32086</guid>
  	<pubDate>Sat, 04 Feb 2006 13:05:38 -0800</pubDate>
  	<dc:creator>ChrisR</dc:creator>
	
	<category>itunes</category>
	
	<category>mac</category>
	
	<category>programming</category>
	
	<category>lib</category>
	
	<category>osx</category>
	
	<category>commandline</category>
	
</item>
<item>
  	<title>By: ChrisR</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502184</link>	
  	<description>I should note that the ideal solution to this will result in 0 duplicate song files, although that&apos;s not a strict requirement.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502184</guid>
  	<pubDate>Sat, 04 Feb 2006 13:06:58 -0800</pubDate>
  	<dc:creator>ChrisR</dc:creator>
</item>
<item>
  	<title>By: mwhybark</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502195</link>	
  	<description>Unfortunately, iTunes is very unfriendly to this sort of networkish thing. Start by poking around at &lt;a href=&quot;http://www.dougscripts.com/itunes/index.php&quot;&gt;Doug&apos;s Applescripts for iTunes&lt;/a&gt; to get a sense of what has been done with iTunes via Applescript. You may also want to check out this tutorial on using &lt;a href=&quot;http://www.macdevcenter.com/pub/a/mac/2002/11/22/itunes_perl.html&quot;&gt;Perl to control iTunes&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
There may be a way to automate swapping variables in the presumptive underlying preferences files; my guess is that these variables are not directly exposed via AppleScript (but could surely be wrong). &lt;br&gt;
&lt;br&gt;
Trying to model this from a long-time Mac-user&apos;s viewpoint, it seems most attempts to solve similar problems with the iApps have involved discrete copies of the actual data (iPhoto libraries, duplicate folder trees of music tracks).&lt;br&gt;
&lt;br&gt;
Best of luck!</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502195</guid>
  	<pubDate>Sat, 04 Feb 2006 13:47:24 -0800</pubDate>
  	<dc:creator>mwhybark</dc:creator>
</item>
<item>
  	<title>By: cillit bang</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502204</link>	
  	<description>There is a file called &amp;quot;iTunes Music Library.xml&amp;quot; in ~/Music/iTunes. You can use the NSPropertyList classes to read and write from it, no libraries required. iTunes will only re-read the XML file if you zero (reduce to zero bytes in length, not delete) the non-XML iTunes Music Library file, which it would otherwise read from.&lt;br&gt;
&lt;br&gt;
That should be enough to get started, though I think what you&apos;re trying to do is much harder than you think.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502204</guid>
  	<pubDate>Sat, 04 Feb 2006 14:13:29 -0800</pubDate>
  	<dc:creator>cillit bang</dc:creator>
</item>
<item>
  	<title>By: adamrice</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502254</link>	
  	<description>I think that all the points in the previous thread apply here. The only twist you add is &amp;quot;the illusion of one library.&amp;quot;&lt;br&gt;
&lt;br&gt;
This illusion could be maintained if you had a script that polled periodically for the presence of the remote drive; if present, switch to the big library; if not, switch to the small library.&lt;br&gt;
&lt;br&gt;
I agree this is Not Easy.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502254</guid>
  	<pubDate>Sat, 04 Feb 2006 16:16:12 -0800</pubDate>
  	<dc:creator>adamrice</dc:creator>
</item>
<item>
  	<title>By: ChrisR</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502411</link>	
  	<description>&amp;quot;Easy&amp;quot; is less of an issue than &amp;quot;Possible.&amp;quot;  Call me arrogant if you wish, but I have reason to believe that, provided the reverse engineering part of it was taken care of, I&apos;d be able to pull the rest off.&lt;br&gt;
&lt;br&gt;
That being said...  Bah.&lt;br&gt;
&lt;br&gt;
You&apos;d think that this sort of thing would be a primary use case for the pro machines.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502411</guid>
  	<pubDate>Sat, 04 Feb 2006 22:20:00 -0800</pubDate>
  	<dc:creator>ChrisR</dc:creator>
</item>
<item>
  	<title>By: cillit bang</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502481</link>	
  	<description>Alright, I don&apos;t think it&apos;s possible in any vaguely reliable way. You&apos;re welcome to try though.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502481</guid>
  	<pubDate>Sun, 05 Feb 2006 04:53:32 -0800</pubDate>
  	<dc:creator>cillit bang</dc:creator>
</item>
<item>
  	<title>By: bonaldi</title>
  	<link>http://ask.metafilter.com/32086/Programmatic-iTunes-library-mods#502509</link>	
  	<description>If iTunes can&apos;t find a music file when it tries to play it, it will flag it and move on; it doesn&apos;t delete it from the library.&lt;br&gt;
&lt;br&gt;
You could just keep one main playlist, and alias the NFS share folders into your iTunes Music Library. When you were off-net, the songs wouldn&apos;t play, but no further damage would occur. &lt;br&gt;
&lt;br&gt;
For example:&lt;br&gt;
&lt;br&gt;
~/Music/iTunes Music Folder/iTunes Music/Band I ripped on MacBook -- real folder&lt;br&gt;
~/Music/iTunes Music Folder/iTunes Music/&lt;i&gt;OldBandFromNFS&lt;/i&gt; -- alias to NFS share&lt;br&gt;
&lt;br&gt;
The only stumbling block would be if you ripped new music off-net and it tried to store it to an aliased folder. Then it would overwrite the alias folder and they&apos;d fall out of sync.&lt;br&gt;
&lt;br&gt;
Also, if you want to keep the NFS share as superset, I&apos;d:&lt;br&gt;
1. Keep a Smart Playlist of &amp;quot;songs added [since] [date of last sync]&amp;quot;&lt;br&gt;
2. Use Automator to script copying the songs in that playlist to the NFS share. &lt;br&gt;
&lt;br&gt;
But this is all going to get into a total mess when you get drunk and just want to play some songs. &lt;br&gt;
&lt;br&gt;
Buy an iPod. It&apos;s designed for this sort of syncing.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.32086-502509</guid>
  	<pubDate>Sun, 05 Feb 2006 07:29:24 -0800</pubDate>
  	<dc:creator>bonaldi</dc:creator>
</item>

    </channel>
</rss>
