Public Access
feat(picker): add the speedrun mood and the speedrun.com link
"What to play next" gets a Speedrun mood. The game detail links the game's speedrun.com page when Core found one with verified runs; only https://www.speedrun.com/ links are shown.
This commit is contained in:
1 parent
b0c78d8dca
commit
23ab5a91e7
7 files changed
+82
-12
No files matched your search
@@ -23,8 +23,9 @@ const BUDGETS = [
|
||||
{key: 'LONG', maxMinutes: 2400},
|
||||
{key: 'ANY', maxMinutes: null},
|
||||
];
|
||||
// The moods Core derives from IGDB's genres, themes and game modes; a mood leaves out games without IGDB data.
|
||||
const MOODS = ['ANY', 'STORY', 'COOP', 'CHILL', 'ACTION', 'SCARY'];
|
||||
// Core derives the moods from IGDB's genres, themes and game modes, and SPEEDRUN from speedrun.com; a mood leaves out
|
||||
// games without that data.
|
||||
const MOODS = ['ANY', 'STORY', 'COOP', 'CHILL', 'ACTION', 'SCARY', 'SPEEDRUN'];
|
||||
const PICK_COUNT = 3;
|
||||
// The backend reads only this many excludes. With a bigger backlog the oldest seen games can come back.
|
||||
const MAX_EXCLUDES = 100;
|
||||
@@ -144,7 +145,9 @@ export default function PlayNextPage() {
|
||||
))}
|
||||
</div>
|
||||
{mood !== 'ANY' && (
|
||||
<p className="text-xs text-muted-foreground">{t('PLAY_NEXT.MOOD_HINT')}</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t(mood === 'SPEEDRUN' ? 'PLAY_NEXT.MOOD_HINT_SPEEDRUN' : 'PLAY_NEXT.MOOD_HINT')}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -188,6 +191,8 @@ export default function PlayNextPage() {
|
||||
}
|
||||
|
||||
const emptyKey = (budget, mood) => {
|
||||
// With a length limit, waiting for the background check may never help.
|
||||
if (mood === 'SPEEDRUN' && !budget.maxMinutes) return 'PLAY_NEXT.EMPTY_SPEEDRUN';
|
||||
if (mood !== 'ANY') return 'PLAY_NEXT.EMPTY_MOOD';
|
||||
return budget.maxMinutes ? 'PLAY_NEXT.EMPTY_BUDGET' : 'PLAY_NEXT.EMPTY';
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user