jaketmp / ePub-quicklook

NOTE: Not working in Mojave and later! ePub quicklook and spotlight plugins for Mac OS X.
BSD 3-Clause "New" or "Revised" License
570 stars 58 forks source link

What is -creators returning? #20

Closed chrisridd closed 12 years ago

chrisridd commented 12 years ago

I started using JTPepub's -creators method in the Spotlight importer, but noticed it returns an array of odd things.

It seems to return pairs of elements - an actual name followed by the role attribute for each creator. Except in the no creators case where it returns an array of just one empty string.

If we wanted to keep it for the Spotlight importer, then a better thing to return would either be an empty array, or just an array of all the creator values. i.e. skip the role attributes. I'd be tempted to make it query dc:contributors as well and put them in the same array. The Spotlight kMDItemContributors (?) attribute doesn't care about the order of the values.

jaketmp commented 12 years ago

-creators was originally going to be my answer to the various -editor - illustrator &c methods you have coded up. I never got around to putting together a full dictionary of possible opt:role= attributes though.

jaketmp commented 12 years ago

Off the top of my head, I can't think of any spotlight metadata attributes more fine grained than kMDItemContributors applicable here, so ditching the opt:role=s and just returning a dictionary of names seems like a good idea.

chrisridd commented 12 years ago

There's scope to add custom attributes into Spotlight (you write a schema XML file) for things like translators, illustrators, etc, but I think a good first cut would be to just get all the creators/contributors into the kMDItemContributors attribute.

(Assume you do mean array and not dictionary BTW :-)