mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-01 00:18:14 +01:00
Update:Show total duration of episodes on podcast page
This commit is contained in:
parent
c312979aec
commit
024d052a7b
@ -105,7 +105,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="tracks.length || audioFile" class="flex py-0.5">
|
<div v-if="tracks.length || audioFile || (isPodcast && totalPodcastDuration)" class="flex py-0.5">
|
||||||
<div class="w-32">
|
<div class="w-32">
|
||||||
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelDuration }}</span>
|
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelDuration }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -415,6 +415,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
durationPretty() {
|
durationPretty() {
|
||||||
|
if (this.isPodcast) return this.$elapsedPrettyExtended(this.totalPodcastDuration)
|
||||||
|
|
||||||
if (!this.tracks.length && !this.audioFile) return 'N/A'
|
if (!this.tracks.length && !this.audioFile) return 'N/A'
|
||||||
if (this.audioFile) return this.$elapsedPrettyExtended(this.duration)
|
if (this.audioFile) return this.$elapsedPrettyExtended(this.duration)
|
||||||
return this.$elapsedPretty(this.duration)
|
return this.$elapsedPretty(this.duration)
|
||||||
@ -423,6 +425,12 @@ export default {
|
|||||||
if (!this.tracks.length && !this.audioFile) return 0
|
if (!this.tracks.length && !this.audioFile) return 0
|
||||||
return this.media.duration
|
return this.media.duration
|
||||||
},
|
},
|
||||||
|
totalPodcastDuration() {
|
||||||
|
if (!this.podcastEpisodes.length) return 0
|
||||||
|
let totalDuration = 0
|
||||||
|
this.podcastEpisodes.forEach((ep) => (totalDuration += ep.duration || 0))
|
||||||
|
return totalDuration
|
||||||
|
},
|
||||||
sizePretty() {
|
sizePretty() {
|
||||||
return this.$bytesPretty(this.media.size)
|
return this.$bytesPretty(this.media.size)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user