Skip to content

recent_downloads is 0 in API data #935

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

Closed
djc opened this issue Aug 3, 2017 · 6 comments
Closed

recent_downloads is 0 in API data #935

djc opened this issue Aug 3, 2017 · 6 comments
Labels
A-backend ⚙️ C-bug 🐞 Category: unintended, undesired behavior

Comments

@djc
Copy link

djc commented Aug 3, 2017

I looked at the API data returned for Askama in order to submit it for AreWeWebYet. I thought it might be nice to expose the recent downloads on that site as well, but when I looked into the data recent_downloads is 0. If I look at https://crates.io/categories/template-engine, however, the value for askama is 226. Also in the API data, the downloads number for the release I did yesterday is 6, so it's not like the underlying data is wrong. (Assuming crate-wide downloads are calculated by summing version downloads.)

@sgrif
Copy link
Contributor

sgrif commented Aug 3, 2017

Are you sure it's 0? I'd expect it to be null on anything other than crates/index.

@natboehm
Copy link
Contributor

natboehm commented Aug 4, 2017

I looked at the API data returned for Askama in order to submit it for AreWeWebYet.

Could you clarify what URL you were requesting where you see recent_downloads being zero?

@natboehm
Copy link
Contributor

natboehm commented Aug 4, 2017

If you mean the route GET /crates/crate_id, recent_downloads is indeed zero. We're currently working on a fix, however as a workaround you could submit a request to the route GET /search?q=askama that searches for the crate. Your crate name of Askama will always be the exact match and I know that the field recent_downloads is definitely accessible there.

For reference, this line in fn show is problematic.

@djc
Copy link
Author

djc commented Aug 8, 2017

Yeah, I'm hitting /crates/crate_id.

@carols10cents
Copy link
Member

carols10cents commented Aug 31, 2017

This was fixed by #1023 which has been deployed! https://crates.io/api/v1/crates/askama is showing me "recent_downloads": 141 :)

@djc
Copy link
Author

djc commented Sep 1, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

No branches or pull requests

5 participants