-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[SourceForge] Fixes, tests and cleaning up #1626
Conversation
server.js
Outdated
let time_period, start_date; | ||
badgeData.text[0] = getLabel('downloads', data); | ||
// get yesterday since today is incomplete | ||
const end_date = new Date((new Date()).getTime() - 1000*60*60*24); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have moment
installed. Do you know if it might provide more readable ways to express these values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, it does make things more readable! I asserted by adding a temporary log line that the number of downloads returned in the different tests were strictly equal before and after this change.
@@ -5500,37 +5500,35 @@ cache(function(data, match, sendBadge, request) { | |||
})); | |||
|
|||
// SourceForge integration. | |||
camp.route(/^\/sourceforge\/([^/]+)\/([^/]*)\/?(.*).(svg|png|gif|jpg|json)$/, | |||
camp.route(/^\/sourceforge\/(dt|dm|dw|dd)\/([^/]*)\/?(.*).(svg|png|gif|jpg|json)$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This pull request goes through the following tasks:
/total
in the badge display for total downloads. In addition to being slightly odd, it was inconsistent with what other badges do for total downloads.Looking forward to feedback! 👍