Skip to content

Commit

Permalink
(Mean + Median)/2 fix
Browse files Browse the repository at this point in the history
* Referred to as a collective rating in the code... this value should be zero according to that routine.
* That routine already has this but I assume it's a "double check?" since `aScripts` can change on the fly... anyhow... groups with 1 script should have a "collective rating" of zero according to the function... so mirroring

Applies to OpenUserJS#93 and post OpenUserJS#1581
  • Loading branch information
Martii committed Feb 5, 2019
1 parent 4a43ab0 commit 41cb13e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/modelParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,10 @@ var parseGroup = function (aGroup) {
group.rating = getRating(aScripts);
}

// `aScripts` may change dynamically so check again
if (aScripts && aScripts.length === 1) {
group.size = aScripts.length;
group.rating = 0;
}

if (aScripts && aScripts.length === 0) {
Expand Down

0 comments on commit 41cb13e

Please sign in to comment.