fix: episode image retrival
All checks were successful
repod / xml (push) Successful in 21s
repod / php (push) Successful in 1m3s
repod / nodejs (push) Successful in 2m33s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-11 23:54:21 +01:00
parent 767a6e9bac
commit b2f2a96f2b

View File

@ -61,14 +61,9 @@ class EpisodeActionReader
// Get episode image // Get episode image
$image = $this->stringOrNull($item->image->url); $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) { if (!$image && $iTunesItemChildren) {
$image = $this->stringOrNull($iTunesItemChildren->image['href']); $imageAttributes = $iTunesItemChildren->image->attributes();
$image = $this->stringOrNull($imageAttributes ? (string) $imageAttributes->href : '');
} }
if (!$image) { if (!$image) {
@ -76,15 +71,8 @@ class EpisodeActionReader
} }
if (!$image && $iTunesChannelChildren) { if (!$image && $iTunesChannelChildren) {
$image = $this->stringOrNull($iTunesChannelChildren->image['href']); $imageAttributes = $iTunesChannelChildren->image->attributes();
} $image = $this->stringOrNull($imageAttributes ? (string) $imageAttributes->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'] : '');
}
} }
if (!$image) { if (!$image) {