fix: various small notice fixes (#3474)

* fix(patreon): php notice

* fix(pepperbridge): php notice

* fix(ebay): php notice

* fix(tiktok): php notice

* fix(yandex): fix notice

* fix(justwatch): notice

* lint
This commit is contained in:
Dag 2023-07-02 06:40:25 +02:00 committed by GitHub
parent 372880b5ef
commit 748fc9fd65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 25 deletions

View file

@ -169,10 +169,17 @@ class JustWatchBridge extends BridgeAbstract
foreach ($titles as $title) {
$item = [];
$item['uri'] = $title->find('a', 0)->href;
$item['title'] = $provider->find('picture > img', 0)->alt . ' - ' . $title->find('.title-poster__image > img', 0)->alt;
$image = $title->find('.title-poster__image > img', 0)->attr['src'];
if (str_starts_with($image, 'data')) {
$image = $title->find('.title-poster__image > img', 0)->attr['data-src'];
$itemTitle = sprintf(
'%s - %s',
$provider->find('picture > img', 0)->alt ?? '',
$title->find('.title-poster__image > img', 0)->alt ?? ''
);
$item['title'] = $itemTitle;
$imageUrl = $title->find('.title-poster__image > img', 0)->attr['src'] ?? '';
if (str_starts_with($imageUrl, 'data')) {
$imageUrl = $title->find('.title-poster__image > img', 0)->attr['data-src'];
}
$content = '<b>Provider:</b> '
@ -190,7 +197,7 @@ class JustWatchBridge extends BridgeAbstract
$content .= '<b>Poster:</b><br><a href="'
. $title->find('a', 0)->href
. '"><img src="'
. $image
. $imageUrl
. '"></a>';
$item['content'] = $content;