Show a logo for podcasts

This commit is contained in:
dece 2023-05-13 02:09:06 +02:00
parent bd12da0a7f
commit bcad3d8493
2 changed files with 14 additions and 0 deletions

View file

@ -176,4 +176,13 @@ class Podcast
return $this; return $this;
} }
public function getLogoUrl(): ?string
{
if ($this->logoFilename === null) {
return null;
}
return Constants::IMAGES_BASE_PATH . $this->logoFilename;
}
} }

View file

@ -43,6 +43,11 @@ class FeedService
$titleElement->appendChild(new DOMText($podcast->getName())); $titleElement->appendChild(new DOMText($podcast->getName()));
$channelElement->appendChild(new DOMElement('description', $podcast->getDescription())); $channelElement->appendChild(new DOMElement('description', $podcast->getDescription()));
$channelElement->appendChild(new DOMElement('link', $podcast->getWebsite())); $channelElement->appendChild(new DOMElement('link', $podcast->getWebsite()));
$imageElement = new DOMElement('image');
$imageElement->appendChild(new DOMElement('url', $podcast->getLogoUrl()));
$imageElement->appendChild(new DOMElement('title', 'logo'));
$imageElement->appendChild(new DOMElement('link', $podcast->getWebsite()));
$channelElement->appendChild($imageElement);
$episodes = $this->entityManager->createQuery( $episodes = $this->entityManager->createQuery(
'SELECT e FROM App\Entity\Episode e' 'SELECT e FROM App\Entity\Episode e'