J-Lindvig/Bibliotek_dk

Sort fails if loan does not have an expiry date

Closed this issue · 5 comments

When a loan does not have an expiry date, the variable defaults to "None", which can't be sorted. Line 184 in library_api.py. Most likely the same will happen in line 194.
Problem is seen with audiobooks on eReolen.
image

Suggest to default the dates to a 100 years in the future or something ridiculous.

Ok, so this looks like it is simple. I can turn this on and off by making a reservation on eReolen and then removing it. I too think it is a little strange that you have to reserve some materials on an electronic platform

Ah, reservations on eReolen have an "expected-date"
image

This little hack in "fetchLoans" prevents the error, but does not make reservations work for eReolen
image

Going through the HTML reveals that it is possible to find the right type of data. The the panels are called the same whether on a single page or separate pages..
eReolen:
image

bibliotek.dk:
image
image

#7 removes the crash, but does not make e-reservations functional