View Single Post
Old 01-25-2021, 05:39 PM   #1104
activedirectory
Member
activedirectory began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2019
Device: none
Quote:
Originally Posted by jhowell View Post
There are two main cases. If the book is already on hold for the current user then the data comes from the HTML page that shows the user's holds. Otherwise it comes from the main HTML page for the book.

The book HTML page has an inline script that assigns a structure containing data about the book to window.OverDrive.mediaItems. In the plugin the get_media_items2() in overdrive.py locates this data and parses it using the JSON decoder. get_current_book_availability() extracts the needed data and calculate_wait_weeks() combines it to produce the wait time estimate.
Thank you - I didn't realize the information was there all along!
activedirectory is offline   Reply With Quote