Skip to content

Commit

Permalink
add read stats in addition to borrows
Browse files Browse the repository at this point in the history
Historically, we've only counted borrowing stats and not access to open materials.
  • Loading branch information
mekarpeles authored Jan 16, 2025
1 parent cb2a4a6 commit 3989a48
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openlibrary/plugins/upstream/borrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def POST(self, key): # noqa: PLR0915
response = lending.get_availability_of_ocaid(edition.ocaid)
availability = response[edition.ocaid] if response else {}
if availability and availability['status'] == 'open':
stats.increment('ol.reads.bookreader')
raise web.seeother(archive_url)

error_redirect = archive_url
Expand Down

0 comments on commit 3989a48

Please sign in to comment.