From c9fb987fcfbe17069ec68fdbc823777079ce574b Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Sat, 2 Jul 2022 11:03:38 +0000 Subject: [PATCH] fix(rss): round episode durations and soundbites refs #214 --- app/Helpers/rss_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php index 1482d2a7..c1b123c1 100644 --- a/app/Helpers/rss_helper.php +++ b/app/Helpers/rss_helper.php @@ -295,7 +295,7 @@ if (! function_exists('get_rss_feed')) { } $item->addChildWithCDATA('description', $episode->getDescriptionHtml($serviceSlug)); - $item->addChild('duration', (string) $episode->audio->duration, $itunesNamespace); + $item->addChild('duration', (string) round($episode->audio->duration), $itunesNamespace); $item->addChild('link', $episode->link); $episodeItunesImage = $item->addChild('image', null, $itunesNamespace); $episodeItunesImage->addAttribute('href', $episode->cover->feed_url); @@ -361,7 +361,7 @@ if (! function_exists('get_rss_feed')) { // TODO: differentiate video from soundbites? $soundbiteElement = $item->addChild('soundbite', $soundbite->title, $podcastNamespace); $soundbiteElement->addAttribute('start_time', (string) $soundbite->start_time); - $soundbiteElement->addAttribute('duration', (string) $soundbite->duration); + $soundbiteElement->addAttribute('duration', (string) round($soundbite->duration, 3)); } foreach ($episode->persons as $person) {