From b2f2a96f2b4e33357a1500f2a141722492d3dece Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 11 Jan 2024 23:54:21 +0100 Subject: [PATCH] fix: episode image retrival --- .../EpisodeAction/EpisodeActionReader.php | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/lib/Core/EpisodeAction/EpisodeActionReader.php b/lib/Core/EpisodeAction/EpisodeActionReader.php index c0450cd..f41362d 100644 --- a/lib/Core/EpisodeAction/EpisodeActionReader.php +++ b/lib/Core/EpisodeAction/EpisodeActionReader.php @@ -61,14 +61,9 @@ class EpisodeActionReader // Get episode image $image = $this->stringOrNull($item->image->url); - $itemChildren = $item->children('http://www.itunes.com/dtds/podcast-1.0.dtd'); - if (!$image && $itemChildren) { - $imageAttributes = (array) $itemChildren->image->attributes(); - $image = $this->stringOrNull(array_key_exists('href', $imageAttributes) ? (string) $imageAttributes['href'] : ''); - } - if (!$image && $iTunesItemChildren) { - $image = $this->stringOrNull($iTunesItemChildren->image['href']); + $imageAttributes = $iTunesItemChildren->image->attributes(); + $image = $this->stringOrNull($imageAttributes ? (string) $imageAttributes->href : ''); } if (!$image) { @@ -76,15 +71,8 @@ class EpisodeActionReader } if (!$image && $iTunesChannelChildren) { - $image = $this->stringOrNull($iTunesChannelChildren->image['href']); - } - - if (!$image) { - $channelChildren = $channel->children('http://www.itunes.com/dtds/podcast-1.0.dtd'); - if ($channelChildren) { - $imageAttributes = (array) $channelChildren->image->attributes(); - $image = $this->stringOrNull(array_key_exists('href', $imageAttributes) ? (string) $imageAttributes['href'] : ''); - } + $imageAttributes = $iTunesChannelChildren->image->attributes(); + $image = $this->stringOrNull($imageAttributes ? (string) $imageAttributes->href : ''); } if (!$image) {