Public Access
feat(play-next): add FRIENDS row and reason text
Shows games from followed users. Reason displays friend name and finish or playtime status. Supports reroll without mood. Added English and German translations.
This commit is contained in:
1 parent
e041c71cf8
commit
6ae2abee07
5 files changed
+37
-7
No files matched your search
@@ -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', 'SERIES', 'SIMILAR', 'STUDIO', 'LONGEST', 'RANDOM'];
|
||||
const ROW_ORDER = ['NEXT_UP', 'SERIES', 'SIMILAR', 'STUDIO', 'FRIENDS', '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';
|
||||
@@ -259,6 +259,11 @@ const reasonText = (reason, t, language) => {
|
||||
if (reason?.source === 'STUDIO') {
|
||||
return t('PLAY_NEXT.REASON.STUDIO', {name: reason.studioName});
|
||||
}
|
||||
if (reason?.source === 'FRIENDS') {
|
||||
return reason.friendFinished
|
||||
? t('PLAY_NEXT.REASON.FRIENDS_FINISHED', {name: reason.friendName})
|
||||
: t('PLAY_NEXT.REASON.FRIENDS_PLAYED', {name: reason.friendName, playtime: formatPlaytime(reason.friendPlaytimeMinutes)});
|
||||
}
|
||||
if (reason?.source === 'LONGEST') {
|
||||
return t('PLAY_NEXT.REASON.LONGEST', {date: formatDate(reason.firstSeenAt, language, {dateStyle: 'medium'})});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user