mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-16 13:50:01 +01:00
fix: various fixes (#3136)
This commit is contained in:
parent
00ff0890bb
commit
b64f8f2a09
@ -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 = [];
|
||||
|
@ -84,12 +84,16 @@ query VODList($channel: String!, $types: [BroadcastType!]) {
|
||||
}
|
||||
}
|
||||
EOD;
|
||||
$channel = $this->getInput('channel');
|
||||
$type = $this->getInput('type');
|
||||
$variables = [
|
||||
'channel' => $this->getInput('channel'),
|
||||
'types' => self::BROADCAST_TYPES[$this->getInput('type')]
|
||||
'channel' => $channel,
|
||||
'types' => self::BROADCAST_TYPES[$type]
|
||||
];
|
||||
$data = $this->apiRequest($query, $variables);
|
||||
|
||||
if ($data->user === null) {
|
||||
throw new \Exception(sprintf('Unable to find channel `%s`', $channel));
|
||||
}
|
||||
$user = $data->user;
|
||||
foreach ($user->videos->edges as $edge) {
|
||||
$video = $edge->node;
|
||||
|
@ -49,20 +49,24 @@ class UsbekEtRicaBridge extends BridgeAbstract
|
||||
$item['author'] = $author->plaintext;
|
||||
}
|
||||
|
||||
$content = null;
|
||||
|
||||
$u = $article->find('a.card-img', 0);
|
||||
|
||||
$uri = $u->href;
|
||||
if (substr($uri, 0, 1) === 'h') { // absolute uri
|
||||
$item['uri'] = $uri;
|
||||
} else { // relative uri
|
||||
$item['uri'] = $this->getURI() . $uri;
|
||||
if ($u) {
|
||||
$uri = $u->href;
|
||||
if (substr($uri, 0, 1) === 'h') {
|
||||
// absolute uri
|
||||
$item['uri'] = $uri;
|
||||
} else {
|
||||
// relative uri
|
||||
$item['uri'] = $this->getURI() . $uri;
|
||||
}
|
||||
if ($fullarticle) {
|
||||
$content = $this->loadFullArticle($item['uri']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($fullarticle) {
|
||||
$content = $this->loadFullArticle($item['uri']);
|
||||
}
|
||||
|
||||
if ($fullarticle && !is_null($content)) {
|
||||
if ($fullarticle && $content) {
|
||||
$item['content'] = $content;
|
||||
} else {
|
||||
$excerpt = $article->find('div.card-excerpt', 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user