Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add read stats in addition to borrows #10349

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mekarpeles
Copy link
Member

Historically, we've only counted borrowing stats and not access to open materials.

One line improvement to track how often open access materials are read from Open Library.

Historically, we've only counted borrowing stats and not access to open materials.
@@ -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')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stats.increment('ol.reads.bookreader')
if not is_bot():
stats.increment('ol.reads.bookreader')

@mekarpeles mekarpeles assigned scottbarnes and unassigned cdrini Jan 21, 2025
@mekarpeles
Copy link
Member Author

mekarpeles commented Jan 21, 2025

Let's just make sure it doesn't break on testing and does record some stat on graphite [for read option and not other options like borrow]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants