0
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-01 11:02:56 +00:00
This commit is contained in:
Anton Smirnov 2025-06-20 15:54:14 +03:00 committed by GitHub
commit e26d50f45f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,13 +59,20 @@ class EpicGamesFreeBridge extends BridgeAbstract
) { ) {
continue; continue;
} }
$slug = $element['productSlug'] ?? $element['catalogNs']['mappings'][0]['pageSlug'] ?? null;
if ($slug !== null) {
$uri = parent::getURI() . $this->getInput('locale') . '/p/' . $slug;
} else {
// slug not found, show the root promos page
$uri = parent::getURI() . $this->getInput('locale') . '/free-games';
}
$item = [ $item = [
'author' => $element['seller']['name'], 'author' => $element['seller']['name'],
'content' => $element['description'], 'content' => $element['description'],
'enclosures' => array_map(fn($item) => $item['url'], $element['keyImages']), 'enclosures' => array_map(fn($item) => $item['url'], $element['keyImages']),
'timestamp' => strtotime($promo['startDate']), 'timestamp' => strtotime($promo['startDate']),
'title' => $element['title'], 'title' => $element['title'],
'uri' => parent::getURI() . $this->getInput('locale') . '/p/' . $element['productSlug'], 'uri' => $uri,
]; ];
$this->items[] = $item; $this->items[] = $item;
} }