Refactor cover image fetching in OpenLibrary added content
authorDan Scott <dan@coffeecode.net>
Mon, 13 Jun 2011 01:24:01 +0000 (21:24 -0400)
committerDan Scott <dan@coffeecode.net>
Mon, 13 Jun 2011 01:31:10 +0000 (21:31 -0400)
commit4fb0cd76af64c962fdda787197aab4c39551109d
tree2ad8291dbee533e65d5ff0fe97294217b93d6774
parent04cad12578ba1154879ad17504e4932c618d2aeb
Refactor cover image fetching in OpenLibrary added content

We were only trying to retrieve images from the items array in the
OpenLibrary response, but there are only items if the OpenLibrary has
online editions available - whereas there may be covers attached to the
metadata for the work. So now we make the metadata work harder.

Also, cut down on broken images in search results by short-circuiting if
OpenLibrary doesn't have a matching record for a given ISBN.

Thanks to Bill Erickson for pointing out that there were a lot of blank
images getting returned due to the items reliance.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm