{
  "attachments": [],
  "comments_archived": true,
  "date": "2005-06-15T16:37:20.000Z",
  "layout": "post",
  "title": "Spotlight Bummers and the CC Metadata Importer",
  "wordpress_id": 653,
  "wordpress_slug": "spotlight-bummers-and-the-cc-metadata-importer",
  "wordpress_url": "http://www.decafbad.com/blog/?p=653",
  "year": "2005",
  "month": "06",
  "day": "15",
  "isDir": false,
  "slug": "spotlight-bummers-and-the-cc-metadata-importer",
  "type": "entry",
  "postName": "2005-06-15-spotlight-bummers-and-the-cc-metadata-importer",
  "html": "<p>I was just snooping through the installer package for Nathan Yergler's <a href=\"http://yergler.net/projects/cc-spotlight/\">CC Metadata Importer</a> looking for some clues toward resolving my gripes noted in <a href=\"http://www.decafbad.com/blog/2005/06/10/blosxom_tiger_and_spotlight\">Blosxom, Tiger, and Spotlight</a>.  In doing so, I just realized that the <a href=\"http://sourceforge.net/mailarchive/forum.php?thread_id=7432157&amp;forum_id=4355\">guts of this importer are written in Python</a>.  That's really pretty nifty and I need to look into this some more.</p>\n<p>However, more toward the gripes from <a href=\"http://www.decafbad.com/blog/2005/06/10/blosxom_tiger_and_spotlight\">that previous post</a>, I'm assuming that this <a href=\"http://yergler.net/projects/cc-spotlight/\">CC Metadata Importer</a> will kick out any other importer dealing with MP3 files once it's installed.  Let's see what happens...  (<em>runs off to install the importer</em>)</p>\n<p>In fact, after I installed the importer, I noticed metadata missing from my MP3s that had been there pre-install, such as:</p>\n<ul>\n<li>kMDItemMediaTypes              = (Sound)</li>\n<li>kMDItemMusicalGenre            = \"Rock\"</li>\n<li>kMDItemTitle                   = \"Sunday\"</li>\n<li>kMDItemTotalBitRate            = 256</li>\n<li>kMDItemAudioBitRate            = 256</li>\n<li>kMDItemAudioChannelCount       = 2</li>\n<li>kMDItemAudioSampleRate         = 44100</li>\n<li>kMDItemAuthors                 = (\"David Bowie\")</li>\n</ul>\n<p>I looked into <code>Audio.mdimporter</code> under <code>/System/Library/Spotlight</code> and this is what I found in <code>Contents/Info.plist</code>:</p>\n  <textarea cols=\"60\" rows=\"10\">    &lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;\n    &lt;array&gt;\n        &lt;dict&gt;\n            &lt;key&gt;CFBundleTypeRole&lt;/key&gt;\n            &lt;string&gt;MDImporter&lt;/string&gt;\n            &lt;key&gt;LSItemContentTypes&lt;/key&gt;\n            &lt;array&gt;\n                &lt;string&gt;public.mp3&lt;/string&gt;\n                &lt;string&gt;public.aifc-audio&lt;/string&gt;\n                &lt;string&gt;public.aiff-audio&lt;/string&gt;\n                &lt;string&gt;com.digidesign.sd2-audio&lt;/string&gt;\n                &lt;string&gt;com.microsoft.waveform-audio&lt;/string&gt;\n                &lt;string&gt;public.ulaw-audio&lt;/string&gt;\n                &lt;string&gt;com.apple.coreaudio-format&lt;/string&gt;\n            &lt;/array&gt;\n        &lt;/dict&gt;\n    &lt;/array&gt;\n  </textarea>\n\n<p>  And, what do you know?  This is what I found in <code>Contents/Info.plist</code> for <code>Creative Commons Metadata Importer.mdimporter</code>:</p>\n  <textarea cols=\"60\" rows=\"10\">    &lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;\n    &lt;array&gt;\n        &lt;dict&gt;\n            &lt;key&gt;CFBundleTypeRole&lt;/key&gt;\n            &lt;string&gt;MDImporter&lt;/string&gt;\n            &lt;key&gt;LSItemContentTypes&lt;/key&gt;\n            &lt;array&gt;\n                &lt;string&gt;public.mp3&lt;/string&gt;\n            &lt;/array&gt;\n        &lt;/dict&gt;\n    &lt;/array&gt;\n  </textarea>\n\n<p>This new importer wants to handle <code>public.mp3</code>, just like Apple's <code>Audio.mdimporter</code>.  So, from my understanding, the CC importer will replace Apple's--rather than cooperating with it, as I'd like to see.  (I wonder if there's any way to hack <em>chaining</em> into these things?)</p>\n<p>When I run <code>mdls</code> on an MP3 I have lying around, this is what I get before installing the importer:</p>\n  <textarea cols=\"60\" rows=\"10\">01 Sunday.mp3 -------------\nkMDItemAlbum                   = \"Heathen\"\nkMDItemAttributeChangeDate     = 2005-05-03 20:41:01 -0400\nkMDItemAudioBitRate            = 256\nkMDItemAudioChannelCount       = 2\nkMDItemAudioSampleRate         = 44100\nkMDItemAuthors                 = (\"David Bowie\")\nkMDItemContentCreationDate     = 2003-01-22 12:43:35 -0500\nkMDItemContentModificationDate = 2005-05-03 20:41:00 -0400\nkMDItemContentType             = \"public.mp3\"\nkMDItemContentTypeTree         = (\n    \"public.mp3\", \n    \"public.audio\", \n    \"public.audiovisual-content\", \n    \"public.data\", \n    \"public.item\", \n    \"public.content\"\n)\nkMDItemDisplayName             = \"01 Sunday.mp3\"\nkMDItemDurationSeconds         = 856\nkMDItemFSContentChangeDate     = 2005-05-03 20:41:00 -0400\nkMDItemFSCreationDate          = 2003-01-22 12:43:35 -0500\nkMDItemFSCreatorCode           = 0\nkMDItemFSFinderFlags           = 0\nkMDItemFSInvisible             = 0\nkMDItemFSLabel                 = 0\nkMDItemFSName                  = \"01 Sunday.mp3\"\nkMDItemFSNodeCount             = 0\nkMDItemFSOwnerGroupID          = 501\nkMDItemFSOwnerUserID           = 501\nkMDItemFSSize                  = 9138342\nkMDItemFSTypeCode              = 0\nkMDItemID                      = 820671\nkMDItemKind                    = \"MP3 Audio File\"\nkMDItemLastUsedDate            = 2003-01-22 12:43:35 -0500\nkMDItemMediaTypes              = (Sound)\nkMDItemMusicalGenre            = \"Rock\"\nkMDItemTitle                   = \"Sunday\"\nkMDItemTotalBitRate            = 256\nkMDItemUsedDates               = (2003-01-22 12:43:35 -0500)\n  </textarea>\n\n<p>So, I installed the CC importer, let it re-index things, and this is what <code>mdls</code> gives me now:</p>\n  <textarea cols=\"60\" rows=\"10\">01 Sunday.mp3 -------------\nkMDItemAttributeChangeDate     = 2005-06-15 12:27:57 -0400\nkMDItemContentCreationDate     = 2003-01-22 12:43:35 -0500\nkMDItemContentModificationDate = 2005-05-03 20:41:00 -0400\nkMDItemContentType             = \"public.mp3\"\nkMDItemContentTypeTree         = (\n    \"public.mp3\", \n    \"public.audio\", \n    \"public.audiovisual-content\", \n    \"public.data\", \n    \"public.item\", \n    \"public.content\"\n)\nkMDItemDisplayName             = \"01 Sunday.mp3\"\nkMDItemFSContentChangeDate     = 2005-05-03 20:41:00 -0400\nkMDItemFSCreationDate          = 2003-01-22 12:43:35 -0500\nkMDItemFSCreatorCode           = 0\nkMDItemFSFinderFlags           = 0\nkMDItemFSInvisible             = 0\nkMDItemFSLabel                 = 0\nkMDItemFSName                  = \"01 Sunday.mp3\"\nkMDItemFSNodeCount             = 0\nkMDItemFSOwnerGroupID          = 501\nkMDItemFSOwnerUserID           = 501\nkMDItemFSSize                  = 9138342\nkMDItemFSTypeCode              = 0\nkMDItemID                      = 820671\nkMDItemKind                    = \"MP3 Audio File\"\nkMDItemLastUsedDate            = 2003-01-22 12:43:35 -0500\nkMDItemUsedDates               = (2003-01-22 12:43:35 -0500)\n  </textarea>\n\n<p>In case those two floods of metadata set your head spinning, the post-install metadata is lacking items from the pre-install metadata.  I need to uninstall this importer and get my other metadata back.  And, this isn't a slight against the importer--it looks like really cool work.  No, this is a bummer of Spotlight.</p>\n<p><em>Almost there...</em></p>\n<div id=\"comments\" class=\"comments archived-comments\"><h3>Archived Comments</h3>\n<ul class=\"comments\">\n<li class=\"comment\" id=\"comment-221088590\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://ulaluma.com/pyx\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=9e03aaf8edbe4b2c0d25e30ab9a69ffb&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://ulaluma.com/pyx\">Donovan Preston</a>\n</div>\n\n\n<p><a href=\"#comment-221088590\" class=\"permalink\"><time datetime=\"2005-06-15T12:55:56\">2005-06-15T12:55:56</time></a></p>\n</div>\n\n\n<div class=\"content\">At WWDC I heard some of the Apple developers complaining about this as well. It certainly is a huge shortcoming of spotlight and hopefully it will be addressed soon. Because of this, for example, it would be impossible to have an importer for * which imported the MD5 hash of every file on your system, or something like that.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221088591\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.fluffy.co.uk/spotmeta/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a660afb8f1f22ce1b03ad3b532aa05b5&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.fluffy.co.uk/spotmeta/\">Ben Summers</a>\n</div>\n\n\n<p><a href=\"#comment-221088591\" class=\"permalink\"><time datetime=\"2005-10-20T14:54:46\">2005-10-20T14:54:46</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>My latest project, SpotMeta, solves this problem. The extension it installs also allows <a href=\"http://www.fluffy.co.uk/spotmeta/devimporters.html\" rel=\"nofollow\">importers to be cascaded</a>.</p></div>\n\n\n</li>\n</ul>\n\n\n</div>\n\n\n",
  "body": "I was just snooping through the installer package for Nathan Yergler's [CC Metadata Importer][cci] looking for some clues toward resolving my gripes noted in [Blosxom, Tiger, and Spotlight][bts].  In doing so, I just realized that the [guts of this importer are written in Python][guts].  That's really pretty nifty and I need to look into this some more.\r\n\r\n[bts]: http://www.decafbad.com/blog/2005/06/10/blosxom_tiger_and_spotlight\r\n[guts]: http://sourceforge.net/mailarchive/forum.php?thread_id=7432157&forum_id=4355\r\n[cci]: http://yergler.net/projects/cc-spotlight/\r\n\r\nHowever, more toward the gripes from [that previous post][bts], I'm assuming that this [CC Metadata Importer][cci] will kick out any other importer dealing with MP3 files once it's installed.  Let's see what happens...  (*runs off to install the importer*)\r\n\r\nIn fact, after I installed the importer, I noticed metadata missing from my MP3s that had been there pre-install, such as:\r\n\r\n* kMDItemMediaTypes              = (Sound)\r\n* kMDItemMusicalGenre            = \"Rock\"\r\n* kMDItemTitle                   = \"Sunday\"\r\n* kMDItemTotalBitRate            = 256\r\n* kMDItemAudioBitRate            = 256\r\n* kMDItemAudioChannelCount       = 2\r\n* kMDItemAudioSampleRate         = 44100\r\n* kMDItemAuthors                 = (\"David Bowie\")\r\n\r\nI looked into `Audio.mdimporter` under `/System/Library/Spotlight` and this is what I found in `Contents/Info.plist`:\r\n\r\n  <textarea cols=\"60\" rows=\"10\">\r\n    <key>CFBundleDocumentTypes</key>\r\n    <array>\r\n        <dict>\r\n            <key>CFBundleTypeRole</key>\r\n            <string>MDImporter</string>\r\n            <key>LSItemContentTypes</key>\r\n            <array>\r\n                <string>public.mp3</string>\r\n                <string>public.aifc-audio</string>\r\n                <string>public.aiff-audio</string>\r\n                <string>com.digidesign.sd2-audio</string>\r\n                <string>com.microsoft.waveform-audio</string>\r\n                <string>public.ulaw-audio</string>\r\n                <string>com.apple.coreaudio-format</string>\r\n            </array>\r\n        </dict>\r\n    </array>\r\n  </textarea>\r\n\r\n  And, what do you know?  This is what I found in `Contents/Info.plist` for `Creative Commons Metadata Importer.mdimporter`:\r\n\r\n  <textarea cols=\"60\" rows=\"10\">\r\n    <key>CFBundleDocumentTypes</key>\r\n    <array>\r\n        <dict>\r\n            <key>CFBundleTypeRole</key>\r\n            <string>MDImporter</string>\r\n            <key>LSItemContentTypes</key>\r\n            <array>\r\n                <string>public.mp3</string>\r\n            </array>\r\n        </dict>\r\n    </array>\r\n  </textarea>\r\n\r\nThis new importer wants to handle `public.mp3`, just like Apple's `Audio.mdimporter`.  So, from my understanding, the CC importer will replace Apple's--rather than cooperating with it, as I'd like to see.  (I wonder if there's any way to hack *chaining* into these things?)\r\n\r\nWhen I run `mdls` on an MP3 I have lying around, this is what I get before installing the importer:\r\n\r\n  <textarea cols=\"60\" rows=\"10\">\r\n01 Sunday.mp3 -------------\r\nkMDItemAlbum                   = \"Heathen\"\r\nkMDItemAttributeChangeDate     = 2005-05-03 20:41:01 -0400\r\nkMDItemAudioBitRate            = 256\r\nkMDItemAudioChannelCount       = 2\r\nkMDItemAudioSampleRate         = 44100\r\nkMDItemAuthors                 = (\"David Bowie\")\r\nkMDItemContentCreationDate     = 2003-01-22 12:43:35 -0500\r\nkMDItemContentModificationDate = 2005-05-03 20:41:00 -0400\r\nkMDItemContentType             = \"public.mp3\"\r\nkMDItemContentTypeTree         = (\r\n    \"public.mp3\", \r\n    \"public.audio\", \r\n    \"public.audiovisual-content\", \r\n    \"public.data\", \r\n    \"public.item\", \r\n    \"public.content\"\r\n)\r\nkMDItemDisplayName             = \"01 Sunday.mp3\"\r\nkMDItemDurationSeconds         = 856\r\nkMDItemFSContentChangeDate     = 2005-05-03 20:41:00 -0400\r\nkMDItemFSCreationDate          = 2003-01-22 12:43:35 -0500\r\nkMDItemFSCreatorCode           = 0\r\nkMDItemFSFinderFlags           = 0\r\nkMDItemFSInvisible             = 0\r\nkMDItemFSLabel                 = 0\r\nkMDItemFSName                  = \"01 Sunday.mp3\"\r\nkMDItemFSNodeCount             = 0\r\nkMDItemFSOwnerGroupID          = 501\r\nkMDItemFSOwnerUserID           = 501\r\nkMDItemFSSize                  = 9138342\r\nkMDItemFSTypeCode              = 0\r\nkMDItemID                      = 820671\r\nkMDItemKind                    = \"MP3 Audio File\"\r\nkMDItemLastUsedDate            = 2003-01-22 12:43:35 -0500\r\nkMDItemMediaTypes              = (Sound)\r\nkMDItemMusicalGenre            = \"Rock\"\r\nkMDItemTitle                   = \"Sunday\"\r\nkMDItemTotalBitRate            = 256\r\nkMDItemUsedDates               = (2003-01-22 12:43:35 -0500)\r\n  </textarea>\r\n\r\nSo, I installed the CC importer, let it re-index things, and this is what `mdls` gives me now:\r\n\r\n  <textarea cols=\"60\" rows=\"10\">\r\n01 Sunday.mp3 -------------\r\nkMDItemAttributeChangeDate     = 2005-06-15 12:27:57 -0400\r\nkMDItemContentCreationDate     = 2003-01-22 12:43:35 -0500\r\nkMDItemContentModificationDate = 2005-05-03 20:41:00 -0400\r\nkMDItemContentType             = \"public.mp3\"\r\nkMDItemContentTypeTree         = (\r\n    \"public.mp3\", \r\n    \"public.audio\", \r\n    \"public.audiovisual-content\", \r\n    \"public.data\", \r\n    \"public.item\", \r\n    \"public.content\"\r\n)\r\nkMDItemDisplayName             = \"01 Sunday.mp3\"\r\nkMDItemFSContentChangeDate     = 2005-05-03 20:41:00 -0400\r\nkMDItemFSCreationDate          = 2003-01-22 12:43:35 -0500\r\nkMDItemFSCreatorCode           = 0\r\nkMDItemFSFinderFlags           = 0\r\nkMDItemFSInvisible             = 0\r\nkMDItemFSLabel                 = 0\r\nkMDItemFSName                  = \"01 Sunday.mp3\"\r\nkMDItemFSNodeCount             = 0\r\nkMDItemFSOwnerGroupID          = 501\r\nkMDItemFSOwnerUserID           = 501\r\nkMDItemFSSize                  = 9138342\r\nkMDItemFSTypeCode              = 0\r\nkMDItemID                      = 820671\r\nkMDItemKind                    = \"MP3 Audio File\"\r\nkMDItemLastUsedDate            = 2003-01-22 12:43:35 -0500\r\nkMDItemUsedDates               = (2003-01-22 12:43:35 -0500)\r\n  </textarea>\r\n\r\nIn case those two floods of metadata set your head spinning, the post-install metadata is lacking items from the pre-install metadata.  I need to uninstall this importer and get my other metadata back.  And, this isn't a slight against the importer--it looks like really cool work.  No, this is a bummer of Spotlight.\r\n\r\n*Almost there...*\r\n\r\n<div id=\"comments\" class=\"comments archived-comments\">\r\n            <h3>Archived Comments</h3>\r\n            \r\n        <ul class=\"comments\">\r\n            \r\n        <li class=\"comment\" id=\"comment-221088590\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://ulaluma.com/pyx\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=9e03aaf8edbe4b2c0d25e30ab9a69ffb&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://ulaluma.com/pyx\">Donovan Preston</a>\r\n                </div>\r\n                <a href=\"#comment-221088590\" class=\"permalink\"><time datetime=\"2005-06-15T12:55:56\">2005-06-15T12:55:56</time></a>\r\n            </div>\r\n            <div class=\"content\">At WWDC I heard some of the Apple developers complaining about this as well. It certainly is a huge shortcoming of spotlight and hopefully it will be addressed soon. Because of this, for example, it would be impossible to have an importer for * which imported the MD5 hash of every file on your system, or something like that.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221088591\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.fluffy.co.uk/spotmeta/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a660afb8f1f22ce1b03ad3b532aa05b5&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.fluffy.co.uk/spotmeta/\">Ben Summers</a>\r\n                </div>\r\n                <a href=\"#comment-221088591\" class=\"permalink\"><time datetime=\"2005-10-20T14:54:46\">2005-10-20T14:54:46</time></a>\r\n            </div>\r\n            <div class=\"content\"><p>My latest project, SpotMeta, solves this problem. The extension it installs also allows <a href=\"http://www.fluffy.co.uk/spotmeta/devimporters.html\" rel=\"nofollow\">importers to be cascaded</a>.</p></div>\r\n            \r\n        </li>\r\n    \r\n        </ul>\r\n    \r\n        </div>\r\n    ",
  "parentPath": "./content/posts/archives/2005",
  "path": "2005/06/15/spotlight-bummers-and-the-cc-metadata-importer",
  "needsBuild": true,
  "prevPostPath": "2005/06/14/two-unrelated-quick-thoughts",
  "prevPostTitle": "Two unrelated quick thoughts",
  "nextPostPath": "2005/06/17/were-engaged",
  "nextPostTitle": "We're engaged!"
}