diff --git a/config/vufind/config.ini b/config/vufind/config.ini index b2e3ac8523d8dfc1d1b355bf0c1f5d8fb7543d3f..6cd00a689f97c5dde828ecb3c6f6fef3acbff17d 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -357,7 +357,7 @@ major = studentmajor ; You can select Syndetics, LibraryThing, Summon, Amazon, Booksite, OpenLibrary, ; Contentcafe and/or Google Books. ; Note: Summon service takes a Serials Solutions client key, NOT Summon API key! -;coverimages = Syndetics:MySyndeticsId,Amazon:MyAccessKeyId,Booksite:MyCATSkey,LibraryThing:MyLibraryThingId,Google,OpenLibrary,Summon:MySerialsSolutionsClientKey,Contentcafe:MyContentCafeID +;coverimages = Syndetics:MySyndeticsId,Amazon:MyAccessKeyId,Booksite,LibraryThing:MyLibraryThingId,Google,OpenLibrary,Summon:MySerialsSolutionsClientKey,Contentcafe:MyContentCafeID ; This setting controls the image to display when no book cover is available. ; The path is relative to the base of your theme directory. @@ -368,7 +368,7 @@ noCoverAvailableImage = images/noCover2.gif ; Note: Guardian reviews contain embedded advertisements. If the API key is not ; supplied, e.g. "Guardian:", only the review title, byline, Guardian logo ; and a link to the full Guardian page will be displayed -;reviews = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsID,AmazonEditorial:MyAccessKeyId,Amazon:MyAccessKeyId,Booksite:MyCATSkey,Guardian:MyGuardianKeyId +;reviews = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsID,AmazonEditorial:MyAccessKeyId,Amazon:MyAccessKeyId,Booksite,Guardian:MyGuardianKeyId ; You can select from Syndetics or SyndeticsPlus ;excerpts = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsId @@ -895,4 +895,4 @@ max_tag_length = 64 ;Solr = Catalog ;Summon = Summon ;WorldCat = WorldCat -;SolrWeb = "Library Website" \ No newline at end of file +;SolrWeb = "Library Website" diff --git a/module/VuFind/src/VuFind/Cover/Loader.php b/module/VuFind/src/VuFind/Cover/Loader.php index 3f03e9cc237e76117f89e0b0ea328ab588e7e599..6b9551223cd75f3fd915439ccb4fd025db07bf46 100644 --- a/module/VuFind/src/VuFind/Cover/Loader.php +++ b/module/VuFind/src/VuFind/Cover/Loader.php @@ -479,6 +479,7 @@ class Loader implements \Zend\Log\LoggerAwareInterface return true; } else { + $this->debug("Failed to retrieve image from " + $url); return false; } } @@ -698,4 +699,24 @@ class Loader implements \Zend\Log\LoggerAwareInterface '/' . $isn . '/' . $this->size; return $this->processImageURL($url); } + + + public function booksite($id) + { + // convert normalized 10 char isn to 13 digits + $isn = $this->isn; + if (strlen($isn) != 13){ + $ISBN = new ISBN($isn); + $isn = $ISBN->get13(); + } + $url = isset($this->config->Booksite->url) ? + $this->config->Booksite->url : 'https://api.booksite.com'; + if (! isset($this->config->Booksite->key)) { + throw new \Exception("Booksite 'key' not set in VuFind config"); + } + $key = $this->config->Booksite->key; + $url = $url . '/poca/content_img?key=' . $key . '&ean=' . $isn; + return $this->processImageURL($url); + } + }