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

Downloads shield shows total 0, what am I missing? #833

Closed
Cigaras opened this issue Nov 11, 2016 · 13 comments
Closed

Downloads shield shows total 0, what am I missing? #833

Cigaras opened this issue Nov 11, 2016 · 13 comments

Comments

@Cigaras
Copy link

Cigaras commented Nov 11, 2016

I could not find information on how to configure this, whatever I do it always shows 0, please help, what am I missing? I did authorize shield.io with github at https://img.shields.io/github-auth

Github All Releases

Link to my project: https://github.com/Cigaras/IPTV.bundle
Link to shield: https://img.shields.io/github/downloads/Cigaras/IPTV.bundle/total.svg

@RedSparr0w
Copy link
Member

if you have a look at the API response there does not seem to be a download_count field, which could either mean no one has downloaded it via the github releases page or it hasn't been updated with recent stats yet.

@Cigaras
Copy link
Author

Cigaras commented Nov 12, 2016

I got that, source code doesn't count, I need to upload a binary.

@Cigaras Cigaras closed this as completed Nov 12, 2016
@gradinkov
Copy link

So it's basically useless for scripting projects that don't have binaries. That's not too helpful.

@ElfQrin
Copy link

ElfQrin commented Dec 23, 2018

I've found this thread because unfortunately I have exactly the same problem: download_count is missing in the GitHub releases API. I only have scripting projects on GitHub and it's a disgrace they only count released binaries and not all releases.

@calebcartwright
Copy link
Member

FWIW The badge linked in the original post is showing 24k downloads now.

@ElfQrin I don't have much context around what you're working with/trying to show, but if you'd like to open a new issue we'd be happy to see if we can help.

@ElfQrin
Copy link

ElfQrin commented Dec 24, 2018

Thank you @calebcartwright , I've just opened a ticket here:

ElfQrin/webservertest#1

@freescout-helpdesk
Copy link

I got that, source code doesn't count, I need to upload a binary.

It looks like your counter is working now. How did you solve this issue? It looks like there is no any binary in your repo https://github.com/Cigaras/IPTV.bundle

@RedSparr0w
Copy link
Member

There are releases now in their repo, which is the download stats that are being counted:
https://github.com/Cigaras/IPTV.bundle/releases

@freescout-helpdesk
Copy link

There are releases now in their repo, which is the download stats that are being counted:
https://github.com/Cigaras/IPTV.bundle/releases

Thanks. We also have releases in our repo, but github API shows no download_count: https://api.github.com/repos/freescout-helpdesk/freescout/releases

By some reason assets parameter which contains download_count is empty in all our repos:

"assets": [

    ],

@RedSparr0w
Copy link
Member

Ah I see what you are saying now,
It's because you haven't got any other files attached to your release, as when the source code is downloaded, GitHub doesn't seem to track it. (or at least they don't give us those stats)

image
image

The only way around it that I can think of is adding your own archive to the releases along side the source code.

@eyalroz
Copy link

eyalroz commented Jun 19, 2022

It is super annoying that the source code doesn't count towards downloads. That means source-only projects can simply not ever track their downloads. I wish GitHub fixed this.

@calebcartwright
Copy link
Member

hello, we also have python script just like the poster here and have we have "releases" in zips but the download button doesn't work and the API does not show download_count. I downloaded the zip from the OP that has a working badge and it's just python and some png/jpg/json files.

https://api.github.com/repos/builder555/PineSAM/releases

What is the difference in how this one is working: https://github.com/Cigaras/IPTV.bundle/releases

thanks

This is answered above, be sure to read the comments and screenshots closely:

#833 (comment)
#833 (comment)

@calebcartwright
Copy link
Member

calebcartwright commented Mar 3, 2023

@River-Mochi - I understand that you're just trying to get your badge working, but before responding to your question I want to stress a couple points:

  • Shields is not a system of record. We fetch data from upstream tools/platforms/services, and we use the data they provide in the badges
  • We're not responsible for those upstream systems, we do not (necessarily) have expertise in the systems we pull data from, and we should not be a first stop for support/inquiries about the behaviors of those upstream systems.

In this case the system of record is GitHub, and questions about/for GitHub should really be directed to GitHub via their supported channels, e.g. https://support.github.com/

That being said, I'll try to recap/rephrase what's been established above in the hopes that provides some clarity for you.

When you create a Release in GitHub (at least those associated with a Tag), GitHub automatically, and transparently/independently of user action, attaches two archive files of the repo's source code at that ref in both zip and tarball formats. Repository owners/maintainers have the option to attach additional "binary assets" to the Release.

Those Release assets often include things like platform native binaries, so that users can grab an executable tool instead of having to build from source.

GitHub internally tracks download counts for release assets, but crucially, GitHub does not track download counts for the two GitHub-generated source archive files. That is in turn reflected in their API response: if your Releases do not have any user-attached Release assets (assets above and beyond the two source archives GitHub adds), then the GitHub API is always going to represent that as there being no downloads.

Shields in turn can only display the data that the system of record gives us, hence the 0 download count badge

(edit: this comment was made in response to a comment that was subsequently deleted)

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

No branches or pull requests

7 participants