Closed rm-hull closed 8 years ago
Hi,
Wondering if the logic in https://github.com/hashobject/jarkeeper.com/blob/master/src/jarkeeper/downloads.clj#L32-L37 is correct?
(defn get-downloads [repo-owner repo-name] (let [resp-by-short-name (clojars-fetch repo-name) resp-by-full-name (clojars-fetch (str repo-owner "/" repo-name))] (if (= 200 (:status resp-by-short-name)) (some-> resp-by-short-name :body :downloads) (some-> resp-by-full-name :body :downloads))))
For example, one of my jars (https://clojars.org/rm-hull/turtle) has 439 downloads, but your badge for it (https://jarkeeper.com/rm-hull/turtle/downloads.svg) shows 16 downloads: this is because https://clojars.org/turtle has 16 downloads.
This is because the code checks the resp-by-short-name first... seems like it ought check the status on resp-by-full-name and use that first instead ?!?
resp-by-short-name
resp-by-full-name
Happy to provide a PR to fix this if you agree
Thanks, Richard
Yeah, you are correct, seems like the bug with the logic. Would love PR!
Hi,
Wondering if the logic in https://github.com/hashobject/jarkeeper.com/blob/master/src/jarkeeper/downloads.clj#L32-L37 is correct?
For example, one of my jars (https://clojars.org/rm-hull/turtle) has 439 downloads, but your badge for it (https://jarkeeper.com/rm-hull/turtle/downloads.svg) shows 16 downloads: this is because https://clojars.org/turtle has 16 downloads.
This is because the code checks the
resp-by-short-name
first... seems like it ought check the status onresp-by-full-name
and use that first instead ?!?Happy to provide a PR to fix this if you agree
Thanks, Richard