From f9c724861ab1381b16aa48efa97e5fa7b7adabd1 Mon Sep 17 00:00:00 2001 From: mruac Date: Thu, 31 Aug 2023 20:33:46 +0930 Subject: [PATCH] resolved github comment https://github.com/RSS-Bridge/rss-bridge/pull/3617/#issuecomment-1699568400 --- bridges/PatreonBridge.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bridges/PatreonBridge.php b/bridges/PatreonBridge.php index 3d19cd81ddb..ad140e41ab9 100644 --- a/bridges/PatreonBridge.php +++ b/bridges/PatreonBridge.php @@ -132,7 +132,8 @@ public function collectData() $audio = $this->findInclude($posts, 'media', $id)->attributes ?? null; } } - $thumbnail = $post->attributes->thumbnail->large ?? $post->attributes->thumbnail->url; + $thumbnail = $post->attributes->thumbnail->large ?? null; + $thumbnail = $thumbnail ?? $post->attributes->thumbnail->url; $thumbnail = $thumbnail ?? $post->attributes->image->thumb_url; $thumbnail = $thumbnail ?? $post->attributes->image->url; $audio_filename = $audio->file_name ?? $item['title']; @@ -146,14 +147,16 @@ public function collectData() break; case 'video_embed': - $thumbnail = $post->attributes->thumbnail->large ?? $post->attributes->thumbnail->url; + $thumbnail = $post->attributes->thumbnail->large ?? null; + $thumbnail = $thumbnail ?? $post->attributes->thumbnail->url; $thumbnail = $thumbnail ?? $post->attributes->image->thumb_url; $thumbnail = $thumbnail ?? $post->attributes->image->url; $item['content'] .= "

🎬 {$item['title']}

"; break; case 'video_external_file': - $thumbnail = $post->attributes->thumbnail->large ?? $post->attributes->thumbnail->url; + $thumbnail = $post->attributes->thumbnail->large ?? null; + $thumbnail = $thumbnail ?? $post->attributes->thumbnail->url; $thumbnail = $thumbnail ?? $post->attributes->image->thumb_url; $thumbnail = $thumbnail ?? $post->attributes->image->url; $item['content'] .= "

🎬 {$item['title']}

";