diff --git a/src/components/listing-parts/game-reports.astro b/src/components/listing-parts/game-reports.astro index c124192..238d362 100644 --- a/src/components/listing-parts/game-reports.astro +++ b/src/components/listing-parts/game-reports.astro @@ -12,6 +12,18 @@ const details = ensureListingDetails(listing) const hasReports = Array.isArray( details.api.reports ) && details.api.reports.length > 0 +const defaultSourceUrl = 'https://applesilicongames.com/' + +function getSourceUrl ( report ) { + // Try to get the source url from the report first + if ( report['Source'].includes('https://') ) { + return report['Source'] + } + + // Otherwise, fall back to the default source url + return defaultSourceUrl +} + --- { hasReports && ( @@ -38,37 +50,37 @@ const hasReports = Array.isArray( details.api.reports ) && details.api.reports.l > 🖥 { report['Resolution'] }

- report['Settings'].length !== 0 -

- ⚙️ { report['Settings'] } -

+ { report['Settings'].length !== 0 && ( +

+ ⚙️ { report['Settings'] } +

+ )} - { report['Source'].includes('https://') && ( -
-
- - )} +
))}