rategame-shared 1.1.498 → 1.1.500
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.
- package/dist/constants/earnedTags.js +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/tagExplainers.d.ts +23 -0
- package/dist/constants/tagExplainers.js +126 -0
- package/dist/helpers/earnedTags/evaluateRatingTags.js +1 -1
- package/package.json +1 -1
|
@@ -123,7 +123,7 @@ exports.STORED_RATING_THRESHOLDS = {
|
|
|
123
123
|
hiddenGemAvg: 85,
|
|
124
124
|
respectWonAvg: 70,
|
|
125
125
|
neutralApprovedAvg: 90,
|
|
126
|
-
certifiedStinkerAvg:
|
|
126
|
+
certifiedStinkerAvg: 33,
|
|
127
127
|
defensiveMasterclassAvg: 80,
|
|
128
128
|
comebackClassicAvg: 85,
|
|
129
129
|
stoplightLosingMax: 33,
|
package/dist/constants/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type EarnedTagId } from "./earnedTags";
|
|
2
|
+
import { type RankedTagId } from "./rankedTags";
|
|
3
|
+
export declare const TAG_TYPES: {
|
|
4
|
+
readonly ranked: "ranked";
|
|
5
|
+
readonly earned: "earned";
|
|
6
|
+
readonly community: "community";
|
|
7
|
+
};
|
|
8
|
+
export type TagType = (typeof TAG_TYPES)[keyof typeof TAG_TYPES];
|
|
9
|
+
export type TagExplainer = {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
type TagExplainerKey = EarnedTagId | RankedTagId | "community";
|
|
14
|
+
export declare const TAG_EXPLAINERS: Record<TagExplainerKey, TagExplainer>;
|
|
15
|
+
type GetTagExplainerOptions = {
|
|
16
|
+
tagType: TagType;
|
|
17
|
+
tag: string;
|
|
18
|
+
league?: string;
|
|
19
|
+
season?: string;
|
|
20
|
+
seasonGroup?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function getTagExplainer({ tagType, tag, league, season, seasonGroup, }: GetTagExplainerOptions): TagExplainer;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTagExplainer = exports.TAG_EXPLAINERS = exports.TAG_TYPES = void 0;
|
|
4
|
+
const earnedTags_1 = require("./earnedTags");
|
|
5
|
+
const rankedTags_1 = require("./rankedTags");
|
|
6
|
+
exports.TAG_TYPES = {
|
|
7
|
+
ranked: "ranked",
|
|
8
|
+
earned: "earned",
|
|
9
|
+
community: "community",
|
|
10
|
+
};
|
|
11
|
+
exports.TAG_EXPLAINERS = {
|
|
12
|
+
[rankedTags_1.RANKED_TAG_IDS.topRated]: {
|
|
13
|
+
name: rankedTags_1.RANKED_TAG_TITLES.topRated,
|
|
14
|
+
description: "Games receive this tag when they rank among the 10 top-rated games in their league for a season or its playoffs.",
|
|
15
|
+
},
|
|
16
|
+
[rankedTags_1.RANKED_TAG_IDS.mostRated]: {
|
|
17
|
+
name: rankedTags_1.RANKED_TAG_TITLES.mostRated,
|
|
18
|
+
description: "Games receive this tag when they rank among the 10 most-rated games in their league for a season or its playoffs.",
|
|
19
|
+
},
|
|
20
|
+
[earnedTags_1.EARNED_TAG_IDS.instantClassic]: {
|
|
21
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.instantClassic],
|
|
22
|
+
description: "Fans loved it immediately: at least 100 ratings averaging 9.5 or higher within one hour of the final.",
|
|
23
|
+
},
|
|
24
|
+
[earnedTags_1.EARNED_TAG_IDS.certifiedClassic]: {
|
|
25
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.certifiedClassic],
|
|
26
|
+
description: "A classic that stood the test of time: at least 250 ratings averaging 9.5 or higher one week after the final.",
|
|
27
|
+
},
|
|
28
|
+
[earnedTags_1.EARNED_TAG_IDS.stoplightGame]: {
|
|
29
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.stoplightGame],
|
|
30
|
+
description: "Winning fans loved it, losing fans did not, and neutrals landed in the middle, with at least five ratings from each group.",
|
|
31
|
+
},
|
|
32
|
+
[earnedTags_1.EARNED_TAG_IDS.hiddenGem]: {
|
|
33
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.hiddenGem],
|
|
34
|
+
description: "A highly rated game flying under the radar: 25 to 99 ratings averaging 8.5 or higher after a week.",
|
|
35
|
+
},
|
|
36
|
+
[earnedTags_1.EARNED_TAG_IDS.oneManShow]: {
|
|
37
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.oneManShow],
|
|
38
|
+
description: "One player received at least 90% of the Player of the Game votes, from a minimum of 50 votes.",
|
|
39
|
+
},
|
|
40
|
+
[earnedTags_1.EARNED_TAG_IDS.respectWon]: {
|
|
41
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.respectWon],
|
|
42
|
+
description: "Even the losing team’s fans rated this game highly, with at least 10 ratings averaging 7.0 or higher.",
|
|
43
|
+
},
|
|
44
|
+
[earnedTags_1.EARNED_TAG_IDS.neutralApproved]: {
|
|
45
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.neutralApproved],
|
|
46
|
+
description: "Neutral fans loved it, with at least 100 neutral ratings averaging 9.0 or higher.",
|
|
47
|
+
},
|
|
48
|
+
[earnedTags_1.EARNED_TAG_IDS.notForEveryone]: {
|
|
49
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.notForEveryone],
|
|
50
|
+
description: "A divisive game with widely spread scores across at least 100 community ratings.",
|
|
51
|
+
},
|
|
52
|
+
[earnedTags_1.EARNED_TAG_IDS.certifiedStinker]: {
|
|
53
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.certifiedStinker],
|
|
54
|
+
description: "A game the community rated poorly, with at least 100 ratings averaging 2.5 or lower.",
|
|
55
|
+
},
|
|
56
|
+
[earnedTags_1.EARNED_TAG_IDS.defensiveMasterclass]: {
|
|
57
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.defensiveMasterclass],
|
|
58
|
+
description: "A low-scoring game by its league’s standards that still earned at least 25 ratings averaging 8.0 or higher.",
|
|
59
|
+
},
|
|
60
|
+
[earnedTags_1.EARNED_TAG_IDS.comebackClassic]: {
|
|
61
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.comebackClassic],
|
|
62
|
+
description: "The winner overcame a significant league-specific deficit, and the game earned at least 25 ratings averaging 8.5 or higher.",
|
|
63
|
+
},
|
|
64
|
+
[earnedTags_1.EARNED_TAG_IDS.nobodySawItComing]: {
|
|
65
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.nobodySawItComing],
|
|
66
|
+
description: "The winner was picked by 15% or fewer of the community across at least 25 pregame picks.",
|
|
67
|
+
},
|
|
68
|
+
[earnedTags_1.EARNED_TAG_IDS.shootout]: {
|
|
69
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.shootout],
|
|
70
|
+
description: "A high-scoring game whose combined score reached its league’s shootout threshold.",
|
|
71
|
+
},
|
|
72
|
+
[earnedTags_1.EARNED_TAG_IDS.majorUpset]: {
|
|
73
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.majorUpset],
|
|
74
|
+
description: "A major underdog won, based on the teams’ seeds or, in eligible regular-season games, the community’s pregame picks.",
|
|
75
|
+
},
|
|
76
|
+
[earnedTags_1.EARNED_TAG_IDS.winnerTakeAll]: {
|
|
77
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.winnerTakeAll],
|
|
78
|
+
description: "The deciding final game of a series, such as Game 7 of a seven-game series.",
|
|
79
|
+
},
|
|
80
|
+
[earnedTags_1.EARNED_TAG_IDS.titleClincher]: {
|
|
81
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.titleClincher],
|
|
82
|
+
description: "The championship game, or final game of the championship series, that decided the title.",
|
|
83
|
+
},
|
|
84
|
+
[earnedTags_1.EARNED_TAG_IDS.ratings1k]: {
|
|
85
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.ratings1k],
|
|
86
|
+
description: "This game reached 1,000 community ratings.",
|
|
87
|
+
},
|
|
88
|
+
[earnedTags_1.EARNED_TAG_IDS.ratings5k]: {
|
|
89
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.ratings5k],
|
|
90
|
+
description: "This game reached 5,000 community ratings.",
|
|
91
|
+
},
|
|
92
|
+
[earnedTags_1.EARNED_TAG_IDS.ratings10k]: {
|
|
93
|
+
name: earnedTags_1.EARNED_TAG_DISPLAY_NAMES[earnedTags_1.EARNED_TAG_IDS.ratings10k],
|
|
94
|
+
description: "This game reached 10,000 community ratings.",
|
|
95
|
+
},
|
|
96
|
+
community: {
|
|
97
|
+
name: "Community Tag",
|
|
98
|
+
description: "A community tag created from hashtags that fans include in their ratings.",
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
function getTagExplainer({ tagType, tag, league, season, seasonGroup, }) {
|
|
102
|
+
if (tagType === exports.TAG_TYPES.ranked && tag in rankedTags_1.RANKED_TAG_TITLES) {
|
|
103
|
+
const rankedTag = exports.TAG_EXPLAINERS[tag];
|
|
104
|
+
const ranking = tag === rankedTags_1.RANKED_TAG_IDS.topRated ? "Top Rated" : "Most Rated";
|
|
105
|
+
const leagueLabel = league ? `${(0, rankedTags_1.getRankedTagLeagueLabel)(league)} ` : "";
|
|
106
|
+
const period = season
|
|
107
|
+
? seasonGroup === "playoffs"
|
|
108
|
+
? `${season} playoffs`
|
|
109
|
+
: `${season} season`
|
|
110
|
+
: seasonGroup === "playoffs"
|
|
111
|
+
? "playoffs"
|
|
112
|
+
: "season";
|
|
113
|
+
return {
|
|
114
|
+
name: rankedTag.name,
|
|
115
|
+
description: `These games ranked among the 10 ${ranking} games in the ${leagueLabel}${period}.`,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (tagType === exports.TAG_TYPES.earned && tag in earnedTags_1.EARNED_TAG_DISPLAY_NAMES) {
|
|
119
|
+
return exports.TAG_EXPLAINERS[tag];
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
name: tag.replace(/^#/, "") || exports.TAG_EXPLAINERS.community.name,
|
|
123
|
+
description: exports.TAG_EXPLAINERS.community.description,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
exports.getTagExplainer = getTagExplainer;
|
|
@@ -72,7 +72,7 @@ function evaluateRatingEarnedTags(game, extras = {}) {
|
|
|
72
72
|
earned.push(earnedTags_1.EARNED_TAG_IDS.notForEveryone);
|
|
73
73
|
}
|
|
74
74
|
if (!(0, evaluateFinalTags_1.alreadyHas)(game, earnedTags_1.EARNED_TAG_IDS.certifiedStinker) &&
|
|
75
|
-
votes >=
|
|
75
|
+
votes >= 20 &&
|
|
76
76
|
weightedAvg <= earnedTags_1.STORED_RATING_THRESHOLDS.certifiedStinkerAvg) {
|
|
77
77
|
earned.push(earnedTags_1.EARNED_TAG_IDS.certifiedStinker);
|
|
78
78
|
}
|