diff --git a/src/Entity/Podcast.php b/src/Entity/Podcast.php index c8e8c87..d64a96e 100644 --- a/src/Entity/Podcast.php +++ b/src/Entity/Podcast.php @@ -176,4 +176,13 @@ class Podcast return $this; } + + public function getLogoUrl(): ?string + { + if ($this->logoFilename === null) { + return null; + } + + return Constants::IMAGES_BASE_PATH . $this->logoFilename; + } } diff --git a/src/Service/FeedService.php b/src/Service/FeedService.php index 66fa1ea..6cabb3c 100644 --- a/src/Service/FeedService.php +++ b/src/Service/FeedService.php @@ -43,6 +43,11 @@ class FeedService $titleElement->appendChild(new DOMText($podcast->getName())); $channelElement->appendChild(new DOMElement('description', $podcast->getDescription())); $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( 'SELECT e FROM App\Entity\Episode e'