-
Notifications
You must be signed in to change notification settings - Fork 319
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
Once flagged
always flagged
?
#288
Comments
Here's another question... Why are we decrementing the @sizzlemctwizzle please explain how this is calculated. It seems to me that flagging ( EDIT: 1 good This is really unclear how we calculate this in plain english. I can see everyones confusion especially since it's not documented anywhere. |
This alternate code maintains hiding the flagged count if the number of votes outranks the flags but fixes the CSS error with not showing the number of votes as reported here. var sumVotesAndFlags = script.votes + script.flags;
var votesRatio = sumVotesAndFlags > 0 ? script.votes / sumVotesAndFlags : 1;
var flagsRatio = sumVotesAndFlags > 0 ? script.flags / sumVotesAndFlags : 0;
var votesPercent = votesRatio * 100;
var flagsPercent = flagsRatio * 100;
if (flagsPercent <= 0) {
votesPercent = script.votes === 0 ? 0 : 100;
flagsPercent = 0;
}
script.votesPercent = votesPercent;
script.flagsPercent = flagsPercent; This alternate code allows everyone to see the flags but only gently until the script votes get outranked by the flags... this is useful to see if a script is "going downhill"... and is preferred in my book from all roles currently enabled. var sumVotesAndFlags = script.votes + script.flags;
var votesRatio = sumVotesAndFlags > 0 ? script.votes / sumVotesAndFlags : 1;
var flagsRatio = sumVotesAndFlags > 0 ? script.flags / sumVotesAndFlags : 0;
var votesPercent = votesRatio * 100;
var flagsPercent = flagsRatio * 100;
if (flagsPercent <= 0) {
votesPercent = script.votes === 0 ? 0 : (sumVotesAndFlags === 0 ? 100 : Math.abs(flagsPercent) / votesPercent * 100);
flagsPercent = 0;
}
script.votesPercent = votesPercent;
script.flagsPercent = flagsPercent; |
* Apparently this isn't needed with a redirect in express under this context Inversely applies to OpenUserJS#200 and included in OpenUserJS#288 Tested on dev and target test script on production when deployed is https://openuserjs.org/scripts/TimidScript/%5BTS%5D_Pixiv++ Hopefully this won't need to be backed out but it's small enough to redeploy
The up/down bar was made before I realised flags wasn't flagCount. flags and rating are both calculated values. Rating goes down if there's upvotes, and goes up by 1 if flagged by a user, and up by 2 if by a script author. Due to how the code is written, you can flag it as a user, submit a script, and unflag it as a script author causing the rating to go up by 1. To get the up/down votes, we need to query every single votes (bad). The proper way would be to serialize the up/down vote count in the script model. Basically the entire voting bar has to be redone. |
I was thinking this was going to be an issue to correct for #134 as I appended to the comment in the last 24 hours at #134 (comment) Thanks for the explanation.
I think you have part of this backwards... on upvotes the
Not necessarily as I mentioned at #134 (comment). |
I have a script with a red flag mostly since its upload… |
@jesus2099 |
No problem @Martii, I was just wondering what this red flag meant. |
@jesus2099 |
Should
flagged
then unflagged
authors and scripts remainflagged
even if theflags
count is zero?I'm thinking this is a bug unless everyone shouldn't be using flagging at all unless they know for certain something is going to the graveyard (in which case why bother flagging) ... otherwise it seems a bit excessive to penalize someone without a chance to remedy the situation... and if they do remedy they are permanently unlisted. :\
The text was updated successfully, but these errors were encountered: