feat(play-next): add series and studio rows
Build, Test & Push Frontend / quality-check (push) Successful in 34s
Build, Test & Push Frontend / docker (push) Successful in 23s

This commit is contained in:
lobo committed 2026-10-06 20:22:53 +02:00
1 parent df3d6d2537
commit e041c71cf8
5 files changed
+41 -8

No files matched your search

+7 -1
View File
@@ -27,7 +27,7 @@ const BUDGETS = [
// games without that data.
const MOODS = ['ANY', 'STORY', 'COOP', 'CHILL', 'ACTION', 'SCARY', 'SPEEDRUN'];
// The rows in the order Core sends them; RANDOM is the mood row.
const ROW_ORDER = ['NEXT_UP', 'SIMILAR', 'LONGEST', 'RANDOM'];
const ROW_ORDER = ['NEXT_UP', 'SERIES', 'SIMILAR', 'STUDIO', 'LONGEST', 'RANDOM'];
// The backend reads only this many excludes. With a bigger backlog the oldest seen games can come back.
const MAX_EXCLUDES = 100;
const ROW_CLASS = 'flex gap-4 overflow-x-auto snap-x snap-mandatory pb-2 sm:grid sm:grid-cols-3 sm:overflow-visible';
@@ -253,6 +253,12 @@ const reasonText = (reason, t, language) => {
playtime: formatPlaytime(reason.anchorPlaytimeMinutes),
});
}
if (reason?.source === 'SERIES') {
return t('PLAY_NEXT.REASON.SERIES', {name: reason.seriesName});
}
if (reason?.source === 'STUDIO') {
return t('PLAY_NEXT.REASON.STUDIO', {name: reason.studioName});
}
if (reason?.source === 'LONGEST') {
return t('PLAY_NEXT.REASON.LONGEST', {date: formatDate(reason.firstSeenAt, language, {dateStyle: 'medium'})});
}