jaketmp/ePub-quicklook

What is -creators returning?

Closed this issue · 3 comments

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.

-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.

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.

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 :-)