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

Rewrite creators #21

Closed chrisridd closed 12 years ago

chrisridd commented 12 years ago

This now finds all the creators and all the contributors and returns an array with just their names instead of names and roles.

I refactored the logic to extract names from file-as attributes into a new method.

Some test cases are added which check creators returns all the expected values for the Untitled and metadata books.

The test cases all succeed.

jaketmp commented 12 years ago

This looks good. While you're working in the spotlight importer, I'm going to take a look at the epub 3 and iBooks compatibility.

chrisridd commented 12 years ago

Good plan. BTW I found some stuff about ONIX at http://wiki.mobileread.com/wiki/ONIX

jaketmp commented 12 years ago

Thanks - iBooks looks like it's identical to epub 2 - and the way Apple have defined its UTI, it even automatically falls back to this plugin. It's crashing at some point though.

chrisridd commented 12 years ago

How are you triggering the crash, do you have a stack trace?

jaketmp commented 12 years ago

Looks like while the iBooks .OPF is identical to epub 2, it wasn't being loaded because it defines it's own mime type: application/x-ibooks+zip rather thanapplication/epub+zip. Hopefully it will just take a tweak to -openEPUBFile: to accept this and load the OPF.

chrisridd commented 12 years ago

Was the crash just in the code trying to detect iBooks? I see you've reworked that code since posting about the crash.

jaketmp commented 12 years ago

Yeah - there was a weakness in the way -initWithFile: called -openEPUBFile: without checking if it returned OK. When presented with an iBook, -openEPUBFile: would return false due to the unrecognised mimetype, but -initWithFile:would ignore this, and still return an object. Now in addition to recognising iBooks, it should return nil if -openEPUBFile: returns false.