feat: add trailer tags to rss if trailer episodes are present
This commit is contained in:
parent
004f804045
commit
80fdd9cfb4
|
@ -348,6 +348,21 @@ if (! function_exists('get_rss_feed')) {
|
||||||
$item->addChild('season', (string) $episode->season_number, $itunesNamespace);
|
$item->addChild('season', (string) $episode->season_number, $itunesNamespace);
|
||||||
$item->addChild('episodeType', $episode->type, $itunesNamespace);
|
$item->addChild('episodeType', $episode->type, $itunesNamespace);
|
||||||
|
|
||||||
|
// If episode is of type trailer, add podcast:trailer tag on channel level
|
||||||
|
if ($episode->type == 'trailer') {
|
||||||
|
$trailer = $channel->addChild('trailer', $episode->title, $podcastNamespace);
|
||||||
|
$trailer->addAttribute('pubdate', $episode->published_at->format(DATE_RFC2822));
|
||||||
|
$trailer->addAttribute(
|
||||||
|
'url',
|
||||||
|
$episode->audio_url . ($enclosureParams === '' ? '' : '?' . $enclosureParams),
|
||||||
|
);
|
||||||
|
$trailer->addAttribute('length', (string) $episode->audio->file_size);
|
||||||
|
$trailer->addAttribute('type', $episode->audio->file_mimetype);
|
||||||
|
if ($episode->season_number !== null) {
|
||||||
|
$trailer->addAttribute('season', (string) $episode->season_number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// add podcast namespace tags for season and episode
|
// add podcast namespace tags for season and episode
|
||||||
$episode->season_number &&
|
$episode->season_number &&
|
||||||
$item->addChild('season', (string) $episode->season_number, $podcastNamespace);
|
$item->addChild('season', (string) $episode->season_number, $podcastNamespace);
|
||||||
|
|
Loading…
Reference in New Issue