mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-01 11:02:56 +00:00
Merge 00eb145320
into 354cea09a7
This commit is contained in:
commit
e26d50f45f
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user