Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Sutton and Blackpool #30

Merged
merged 16 commits into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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