Skip to content

feat(papers): count and show views and downloads of each paper - #570

Open
Dx-Alz-xD wants to merge 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/paper-view-download-counts
Open

Dx-Alz-xD wants to merge 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/paper-view-download-counts

Conversation

@Dx-Alz-xD

Copy link
Copy Markdown

📌 Purpose

Show how many times each paper was viewed and downloaded, as asked in #551. This covers the counters; likes and comments need decisions on accounts and moderation first.


Corresponding issue: part of #551


🖼️ Showcase

image image

🔧 Changes

  • views and downloads on each paper (default 0)
  • POST /api/paper-counts with { kind: "view" | "download", paperIds } (up to 100, so a zip is one request); it returns the updated counts
  • One visitor counts once an hour per paper and kind (Upstash), so refreshing doesn't inflate the numbers
  • A view counts when the paper page or the card preview opens; a download counts only when it actually worked, from the card, the viewer or the zip
  • Counts show on cards and under the paper title, and update right after a view or download

➕ Additional Notes

  • The catalogue list can lag up to a minute behind, since /api/papers is cached for 60 seconds
  • Likes and comments are left for a separate discussion

each paper now stores how often it was viewed and downloaded. opening
the paper page or the card preview counts a view, and a download that
worked counts a download, from the card, the viewer or the zip. one
visitor counts once an hour per paper, and the counts show on the cards
and under the paper title

This branch has not been deployed

No deployments
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.

1 participant