diff --git a/client/components/modals/podcast/EpisodeFeed.vue b/client/components/modals/podcast/EpisodeFeed.vue index 6b99cee7a..7ec14ccdc 100644 --- a/client/components/modals/podcast/EpisodeFeed.vue +++ b/client/components/modals/podcast/EpisodeFeed.vue @@ -35,14 +35,7 @@

{{ episode.subtitle }}

-
- -

Published {{ episode.publishedAt ? $dateDistanceFromNow(episode.publishedAt) : 'Unknown' }}

- -

{{ $strings.LabelDuration }}: {{ $elapsedPretty(episode.durationSeconds) }}

- -

{{ $strings.LabelSize }}: {{ $bytesPretty(Number(episode.enclosure.length)) }}

-
+

Published {{ episode.publishedAt ? $dateDistanceFromNow(episode.publishedAt) : 'Unknown' }}

diff --git a/client/components/modals/podcast/ViewEpisode.vue b/client/components/modals/podcast/ViewEpisode.vue index 2502a5ea4..b4358c5d5 100644 --- a/client/components/modals/podcast/ViewEpisode.vue +++ b/client/components/modals/podcast/ViewEpisode.vue @@ -34,12 +34,6 @@ {{ audioFileSize }}

-
-

{{ $strings.LabelDuration }}

-

- {{ audioFileDuration }} -

-
@@ -96,10 +90,6 @@ export default { return this.$bytesPretty(size) }, - audioFileDuration() { - const duration = this.episode.duration || 0 - return this.$elapsedPretty(duration) - }, bookCoverAspectRatio() { return this.$store.getters['libraries/getBookCoverAspectRatio'] } diff --git a/server/utils/podcastUtils.js b/server/utils/podcastUtils.js index b62e024f0..12469160e 100644 --- a/server/utils/podcastUtils.js +++ b/server/utils/podcastUtils.js @@ -25,7 +25,6 @@ const Fuse = require('../libs/fusejs') * @property {string} episode * @property {string} author * @property {string} duration - * @property {number|null} durationSeconds - Parsed from duration string if duration is valid * @property {string} explicit * @property {number} publishedAt - Unix timestamp * @property {{ url: string, type?: string, length?: string }} enclosure @@ -218,9 +217,8 @@ function extractEpisodeData(item) { }) // Extract psc:chapters if duration is set - episode.durationSeconds = episode.duration ? timestampToSeconds(episode.duration) : null - - if (item['psc:chapters']?.[0]?.['psc:chapter']?.length && episode.durationSeconds) { + let episodeDuration = !isNaN(episode.duration) ? timestampToSeconds(episode.duration) : null + if (item['psc:chapters']?.[0]?.['psc:chapter']?.length && episodeDuration) { // Example chapter: // {"id":0,"start":0,"end":43.004286,"title":"chapter 1"} @@ -246,7 +244,7 @@ function extractEpisodeData(item) { } else { episode.chapters = cleanedChapters.map((chapter, index) => { const nextChapter = cleanedChapters[index + 1] - const end = nextChapter ? nextChapter.start : episode.durationSeconds + const end = nextChapter ? nextChapter.start : episodeDuration return { id: chapter.id, title: chapter.title, @@ -275,7 +273,6 @@ function cleanEpisodeData(data) { episode: data.episode || '', author: data.author || '', duration: data.duration || '', - durationSeconds: data.durationSeconds || null, explicit: data.explicit || '', publishedAt, enclosure: data.enclosure,