fix: various fixes (#3136)

This commit is contained in:
Dag 2022-11-08 21:17:32 +01:00 committed by GitHub
parent 00ff0890bb
commit b64f8f2a09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 15 deletions

View file

@ -64,7 +64,11 @@ TEXT;
}
// Sort by timestamp descending
usort($this->items, fn ($a, $b) => $b['timestamp'] <=> $a['timestamp']);
usort($this->items, function ($a, $b) {
$t1 = $a['timestamp'] ?? $a['uri'] ?? $a['title'];
$t2 = $b['timestamp'] ?? $b['uri'] ?? $b['title'];
return $t2 <=> $t1;
});
// Remove duplicates by using url as unique key
$items = [];