Refactor cover image fetching in OpenLibrary added content
authorDan Scott <dan@coffeecode.net>
Mon, 13 Jun 2011 01:24:01 +0000 (21:24 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 21 Jun 2011 19:18:36 +0000 (15:18 -0400)
commitee4a2cb8f73cc15311f9fc777e287dd98744b3e1
tree84ed5fd6a1a9eaf4f832e9505e61a936582dc642
parent976321b7af3b9967df38f8adef617fce9eca9ff2
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>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm
Open-ILS/web/opac/skin/default/js/result_common.js