more filling out of game page
This commit is contained in:
@@ -33,6 +33,8 @@ export interface DetailedGame extends Game {
|
||||
favorite?: boolean;
|
||||
manualUrl?: string;
|
||||
platformId?: number;
|
||||
videoUrl?: string; // Direct video link
|
||||
youtubeId?: string; // YouTube ID for embed
|
||||
}
|
||||
|
||||
export interface RommCollection {
|
||||
@@ -309,7 +311,6 @@ export const rommApiClient = {
|
||||
genres: getAll('genres').map(sanitize).filter(Boolean),
|
||||
franchises: getAll('franchises').map(sanitize).filter(Boolean),
|
||||
releaseDate: formatDate(json.release_date || getFirst('first_release_date') || getFirst('release_date')),
|
||||
screenshots: (json.screenshots || []).map((s: any) => s.url ? getFullImageUrl(s.url) || '' : ''),
|
||||
fsName: json.fs_name,
|
||||
regions: regions.length > 0 ? regions : ['Global'],
|
||||
players: (() => {
|
||||
@@ -338,6 +339,13 @@ export const rommApiClient = {
|
||||
favorite: (json.user_collections || json.rom_collections || []).some((c: any) => c.is_favorite || c.name === 'Favorites'),
|
||||
manualUrl: getFullImageUrl(json.url_manual),
|
||||
platformId: json.platform_id,
|
||||
videoUrl: getFullImageUrl(json.url_video || json.ss_metadata?.video_url),
|
||||
youtubeId: json.youtube_video_id || json.igdb_metadata?.youtube_video_id || json.launchbox_metadata?.youtube_video_id,
|
||||
screenshots: Array.from(new Set([
|
||||
...(json.merged_screenshots || []).map((s: string) => getFullImageUrl(s)),
|
||||
...(json.screenshots || []).map((s: any) => s.url ? getFullImageUrl(s.url) || '' : ''),
|
||||
...(getFirst('screenshots') || [])
|
||||
])).filter(Boolean) as string[],
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user