Skip to content

Improve Top Downloaded Apps to use last 24 months aggregation#119

Open
qzMalekuz wants to merge 1 commit intocytoscape:masterfrom
qzMalekuz:improve-top-downloads-24m
Open

Improve Top Downloaded Apps to use last 24 months aggregation#119
qzMalekuz wants to merge 1 commit intocytoscape:masterfrom
qzMalekuz:improve-top-downloads-24m

Conversation

@qzMalekuz
Copy link
Copy Markdown

This PR updates the Top Downloaded Apps UI to use aggregated
download data from the last 24 months using ReleaseDownloadsByDate.

  • Uses ORM aggregation (Sum over count)
  • Preserves ordering via Case/When
  • Does NOT modify the existing downloads field
  • Does NOT change desktop behavior
  • Scoped to UI display only (per issue Improvement on Top Downloaded Apps #112)

Let me know if you would prefer the logic structured differently.
Related to #112

@coleslaw481
Copy link
Copy Markdown
Contributor

Could you add unit tests to apps/tests.py to verify this change works. thanks

@coleslaw481
Copy link
Copy Markdown
Contributor

Also there is another pull request someone else did on 112: #113
which one makes more sense to merge?

@qzMalekuz qzMalekuz force-pushed the improve-top-downloads-24m branch 2 times, most recently from f5bfd08 to e373566 Compare March 4, 2026 03:20
@qzMalekuz qzMalekuz force-pushed the improve-top-downloads-24m branch from e373566 to e49c04a Compare March 4, 2026 03:51
@qzMalekuz
Copy link
Copy Markdown
Author

I’ve added the requested unit tests in apps/tests.py (TopDownloadedAppsTestCase), and all tests are passing successfully.

This implementation aggregates download counts from ReleaseDownloadsByDate over the last 24 months using Django ORM (Sum). Since download history is stored in ReleaseDownloadsByDate, aggregating from this model ensures the ranking reflects downloads within the specified time window rather than relying on the lifetime downloads field, which makes more sense.

This approach also avoids modifying the existing downloads field and keeps the change limited to the UI ranking logic, aligning with the current data model.

Thank You.

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.

2 participants