Skip to content

Show release download totals (data is already parsed, just not summed) #20

Description

@kellylford

Summary

FastGH already reads release asset download counts — it just never totals them. I'd like to surface the totals, but wanted to ask before writing anything, in case this isn't a direction you want.

What's already there

ReleaseAsset parses download_count, and ReleaseAsset.format_display() renders it, so the Assets list in the release dialog already shows per-file counts:

MyApp-setup.exe (92.7 MB, 27 downloads)

That part works well, and tests/test_models_release.py already covers the parsing.

What's missing

There's no aggregation, so a release never shows a download number anywhere:

  • Release has no total. Release.format_display() shows (3 assets) — the asset count, not downloads.
  • show_release_preview() in GUI/releases.py prints Assets: 3 with no downloads line.
  • ReleaseDialog.update_info_text() does the same.

So to find out how many times a release was downloaded, you have to open it and add the asset numbers up yourself.

What I'd propose

Small and contained — the data is already in the model:

  1. A property on Release:
@property
def total_downloads(self) -> int:
    """Total downloads across every asset in this release."""
    return sum(a.download_count for a in self.assets)
  1. Include it in Release.format_display(), so the releases list reads:
v1.2.0: Some Release - Release (3 assets, 61 downloads) - 2w ago
  1. A Downloads: 61 line in both show_release_preview() and ReleaseDialog.update_info_text(), next to the existing Assets: line.

  2. Tests alongside the existing ones in tests/test_models_release.py, including the zero-asset case.

Deliberately not proposing

  • A repo-wide total across releases. Useful, but it needs a home in the UI and that's a design call that's yours to make, not something to slip into this.
  • Reordering the assets list by download count. It's arguably more useful when you're looking at counts, but it changes existing behaviour, so I'd rather leave it alone unless you want it.

Why I think it's worth it

GitHub records these counts and shows them nowhere in its own web UI — the only way to see them is the API. A GitHub client that surfaces them is doing something the website can't, and the numbers are genuinely useful if you ship software and want to know whether anyone is taking it.

Happy to send a PR in the same shape as #17 if you're interested. If not, no problem at all — I'd rather ask first than send something unwanted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions