LP#
1673870: Handle OverDrive ebook checkout and download
The workflow for checking out and downloading a title via the OverDrive
API is relatively complex:
1. Check out a title.
2. Lock in a specific format for the checked-out title. Once you lock
in a format, you can only download the title in that format -- except
that the browser-based OverDrive Read and OverDrive Listen formats are
always available (if supported for that title), even if you've locked in
another format.
3. Request a link for downloading the title in the specified format.
Download links are dynamically generated and only work for 60 seconds
from the time of your request.
To simplify the process, we require the user to lock in a format during
checkout. Then, when the user clicks the Download button, we request a
download link; OverDrive responds with a URL, and we immediately
redirect the current browser tab/window to that URL.
A new API call, open-ils.ebook_api.title.get_download_link, has been
added for requesting the download link. Since API calls are not
vendor-specific, we also add support for the new method in the test
module, complete with unit test.
Supplementary fixes:
- show spinner in My Account while loading from ebook API
- ensure session ID is available to ebook object during transactions
- fix display of ebook formats
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>