mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
parent
321ec7c8c1
commit
192fc0ee9b
@ -41,16 +41,32 @@ TEXT;
|
|||||||
$this->getInput('feed_4'),
|
$this->getInput('feed_4'),
|
||||||
$this->getInput('feed_5'),
|
$this->getInput('feed_5'),
|
||||||
];
|
];
|
||||||
|
|
||||||
// Remove empty values
|
// Remove empty values
|
||||||
$feeds = array_filter($feeds);
|
$feeds = array_filter($feeds);
|
||||||
|
|
||||||
foreach ($feeds as $feed) {
|
foreach ($feeds as $feed) {
|
||||||
// Fetch all items from the feed
|
// Fetch all items from the feed
|
||||||
$this->collectExpandableDatas($feed);
|
$this->collectExpandableDatas($feed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort by timestamp descending
|
// Sort by timestamp descending
|
||||||
usort($this->items, fn($a, $b) => $b['timestamp'] <=> $a['timestamp']);
|
usort($this->items, fn($a, $b) => $b['timestamp'] <=> $a['timestamp']);
|
||||||
|
|
||||||
|
// Remove duplicates
|
||||||
|
$items = [];
|
||||||
|
foreach ($this->items as $item) {
|
||||||
|
$index = $item['uri'] ?? null;
|
||||||
|
if ($index) {
|
||||||
|
// Overwrite duplicates
|
||||||
|
$items[$index] = $item;
|
||||||
|
} else {
|
||||||
|
$items[] = $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Grab the first $limit items
|
// Grab the first $limit items
|
||||||
$this->items = array_slice($this->items, 0, $limit);
|
$this->items = array_slice(array_values($items), 0, $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIcon()
|
public function getIcon()
|
||||||
|
Loading…
Reference in New Issue
Block a user