mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-03-01 00:15:54 +01:00
Change: Play button for podcast picks first episode in table
This commit is contained in:
parent
706b2d7d72
commit
5f105dc6cc
@ -267,6 +267,9 @@ export default {
|
|||||||
podcastEpisodes() {
|
podcastEpisodes() {
|
||||||
return this.media.episodes || []
|
return this.media.episodes || []
|
||||||
},
|
},
|
||||||
|
sortedEpisodeIds() {
|
||||||
|
return this.$store.getters.getSortedEpisodeIds
|
||||||
|
},
|
||||||
title() {
|
title() {
|
||||||
return this.mediaMetadata.title || 'No Title'
|
return this.mediaMetadata.title || 'No Title'
|
||||||
},
|
},
|
||||||
@ -534,7 +537,8 @@ export default {
|
|||||||
let episodeId = null
|
let episodeId = null
|
||||||
const queueItems = []
|
const queueItems = []
|
||||||
if (this.isPodcast) {
|
if (this.isPodcast) {
|
||||||
const episodesInListeningOrder = this.podcastEpisodes.map((ep) => ({ ...ep })).sort((a, b) => String(a.publishedAt).localeCompare(String(b.publishedAt), undefined, { numeric: true, sensitivity: 'base' }))
|
const episodesInListeningOrder = [...this.sortedEpisodeIds].reverse().map((id) => this.podcastEpisodes.find((ep) => ep.id === id))
|
||||||
|
console.log('Episodes in listening order', episodesInListeningOrder)
|
||||||
|
|
||||||
// Find most recent episode unplayed
|
// Find most recent episode unplayed
|
||||||
let episodeIndex = episodesInListeningOrder.findLastIndex((ep) => {
|
let episodeIndex = episodesInListeningOrder.findLastIndex((ep) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user