rategame-shared 1.1.499 → 1.1.501

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,7 +123,7 @@ exports.STORED_RATING_THRESHOLDS = {
123
123
  hiddenGemAvg: 85,
124
124
  respectWonAvg: 70,
125
125
  neutralApprovedAvg: 90,
126
- certifiedStinkerAvg: 25,
126
+ certifiedStinkerAvg: 33,
127
127
  defensiveMasterclassAvg: 80,
128
128
  comebackClassicAvg: 85,
129
129
  stoplightLosingMax: 33,
@@ -10,4 +10,5 @@ export declare function getWinnerPickShare(game: UnionGame): number | null;
10
10
  export declare function getTotalPickCount(game: UnionGame): number;
11
11
  export declare function getRatingStdDev(rating: GameRatingAggregate | undefined): number;
12
12
  export declare function minutesSinceFinish(game: UnionGame, now?: number): number;
13
+ export declare function hoursSinceFinish(game: UnionGame, now?: number): number;
13
14
  export declare function daysSinceFinish(game: UnionGame, now?: number): number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.daysSinceFinish = exports.minutesSinceFinish = exports.getRatingStdDev = exports.getTotalPickCount = exports.getWinnerPickShare = exports.isHomeWinner = exports.hasDecidedWinner = exports.getGroupAvg = exports.getGroupVoteCount = exports.getCombinedScore = exports.getWeightedAvg = exports.getVoteCount = void 0;
3
+ exports.daysSinceFinish = exports.hoursSinceFinish = exports.minutesSinceFinish = exports.getRatingStdDev = exports.getTotalPickCount = exports.getWinnerPickShare = exports.isHomeWinner = exports.hasDecidedWinner = exports.getGroupAvg = exports.getGroupVoteCount = exports.getCombinedScore = exports.getWeightedAvg = exports.getVoteCount = void 0;
4
4
  function getVoteCount(game) {
5
5
  var _a, _b, _c, _d;
6
6
  return (_d = (_c = (_b = (_a = game.ratings) === null || _a === void 0 ? void 0 : _a.weightedRating) === null || _b === void 0 ? void 0 : _b.votes) === null || _c === void 0 ? void 0 : _c.total) !== null && _d !== void 0 ? _d : 0;
@@ -86,6 +86,13 @@ function minutesSinceFinish(game, now = Date.now()) {
86
86
  return (now - game.finishedAt) / (60 * 1000);
87
87
  }
88
88
  exports.minutesSinceFinish = minutesSinceFinish;
89
+ function hoursSinceFinish(game, now = Date.now()) {
90
+ if (!game.finishedAt) {
91
+ return Number.POSITIVE_INFINITY;
92
+ }
93
+ return (now - game.finishedAt) / (60 * 60 * 1000);
94
+ }
95
+ exports.hoursSinceFinish = hoursSinceFinish;
89
96
  function daysSinceFinish(game, now = Date.now()) {
90
97
  if (!game.finishedAt) {
91
98
  return 0;
@@ -43,6 +43,7 @@ function evaluateRatingEarnedTags(game, extras = {}) {
43
43
  }
44
44
  }
45
45
  if (!(0, evaluateFinalTags_1.alreadyHas)(game, earnedTags_1.EARNED_TAG_IDS.hiddenGem) &&
46
+ (0, aggregates_1.daysSinceFinish)(game, now) <= 9 &&
46
47
  votes >= 25 &&
47
48
  votes <= 99 &&
48
49
  weightedAvg >= earnedTags_1.STORED_RATING_THRESHOLDS.hiddenGemAvg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.499",
3
+ "version": "1.1.501",
4
4
  "description": "This package contains shared resources for the Rate Game project.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",