Commit 9e58846f authored by Laurent's avatar Laurent

upgrade syracuse/ermes adapter

parent 0df5a001
......@@ -163,7 +163,7 @@ export class Ermes extends PortalAdapter {
protected _parseLoansHTML(account, response): Array<Loan> {
let loans: Array<Loan> = new Array<Loan>()
let loans: Map<string, Loan> = new Map<string, Loan>()
let $ = cheerio.load(response.content.toJSON().d)
let datas = $('.loan-results li.loan-item')
......@@ -194,16 +194,18 @@ export class Ermes extends PortalAdapter {
? loan_data.DateRetour
: node.find('.dateretour .loan-info-value').text().trim().split(' ')[0].trim()
let loan = new Loan()
.setLoanId(loan_data.HoldingId)
.setTitle(title)
.setAuthor(author)
.setDateDue(date_due.split('/').reverse().join('-'))
.setRecordId(record_id)
.setRecordUrl(record_link)
.setRecordThumbnail(thumbnail)
loans.push(new Loan()
.setLoanId(loan_data.HoldingId)
.setTitle(title)
.setAuthor(author)
.setDateDue(date_due.split('/').reverse().join('-'))
.setRecordId(record_id)
.setRecordUrl(record_link)
.setRecordThumbnail(thumbnail))
loans.set(loan.getLoanId(), loan)
})
return loans
return Array.from(loans.values());
}
}
......@@ -410,7 +410,12 @@ export class ErmesLoansWithSuccessfulLoginV2 extends ErmesLoansWithSuccessfulLog
export class ErmesLoansWithSuccessfulLoginV3 extends ErmesLoansWithSuccessfulLoginV1 {
public accountPage(): string {
public accountPage(): string {
return this._oneLoan() + this._oneLoan();
}
public _oneLoan(): string {
return '\
<div class="loan-results">\
<ul class="notice">\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment