Skip to content

Commit

Permalink
Fixes for Sutton and Blackpool (#30)
Browse files Browse the repository at this point in the history
* West Sussex moved to Arena v7

* Haringey move to Enterprise

* East Lothian has moved to Spydus

* Falkirk has moved to Spydus

* North Lincolnshire move to Arena v7

* Southampton has removed individual libraries

* Fix Surrey and Sutton

* Fixes for Sutton and Blackpool
  • Loading branch information
cpwood committed Feb 11, 2023
1 parent 235e9da commit cbd751c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions connectors/blackpool.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ console.log('blackpool connector loading...')
*/
exports.getService = (service) => common.getService(service)

getLibrariesInternal = async function (service) {
getBlackpoolLibrariesInternal = async function (service) {
const agent = request.agent()
const response = {
libraries: []
Expand Down Expand Up @@ -44,7 +44,7 @@ getLibrariesInternal = async function (service) {
*/
exports.getLibraries = async function (service) {
const responseLibraries = common.initialiseGetLibrariesResponse(service)
const libs = await getLibrariesInternal(service);
const libs = await getBlackpoolLibrariesInternal(service);

responseLibraries.exception = libs.exception;
responseLibraries.libraries = libs.libraries.map(x => x.name)
Expand Down Expand Up @@ -78,7 +78,7 @@ exports.searchByISBN = async function (isbn, service) {

responseHoldings.id = `${titleId}`

const libs = await getLibrariesInternal(service)
const libs = await getBlackpoolLibrariesInternal(service)

const titleSearch = `https://api.blackpool.gov.uk/live/api/library/standard/lookupTitleInformation/${titleId}`
const titleRequest = await agent.get(titleSearch).timeout(30000)
Expand Down
9 changes: 6 additions & 3 deletions connectors/luci.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ console.log('luci connector loading...')
*/
exports.getService = (service) => common.getService(service)

getLibrariesInternal = async function (service) {
getLuciLibrariesInternal = async function (service) {
const agent = request.agent()
const response = {
libraries: []
Expand Down Expand Up @@ -42,7 +42,7 @@ getLibrariesInternal = async function (service) {
*/
exports.getLibraries = async function (service) {
const responseLibraries = common.initialiseGetLibrariesResponse(service)
const libs = await getLibrariesInternal(service);
const libs = await getLuciLibrariesInternal(service);

responseLibraries.exception = libs.exception;
responseLibraries.libraries = libs.libraries.map(x => x.name)
Expand Down Expand Up @@ -94,7 +94,10 @@ exports.searchByISBN = async function (isbn, service) {
responseHoldings.id = result.recordID;
responseHoldings.url = `${service.Url}manifestations/${result.recordID}`;

resp = await agent.get(`${service.Url}api/record?id=${result.recordID}&source=ILSWS`).timeout(20000);
resp = await agent.get(`${service.Url}api/record?id=${result.recordID}&source=ILSWS`)
.set('solus-app-id', appId)
.timeout(20000);

let libraries = resp.body.data.copies.map(x => x.location.locationName);

// Get unique library values.
Expand Down

0 comments on commit cbd751c

Please sign in to comment.