mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-04-25 01:16:40 +02:00
Fix: double reverse of array
This commit is contained in:
parent
5f105dc6cc
commit
72169990ac
@ -537,14 +537,15 @@ export default {
|
||||
let episodeId = null
|
||||
const queueItems = []
|
||||
if (this.isPodcast) {
|
||||
const episodesInListeningOrder = [...this.sortedEpisodeIds].reverse().map((id) => this.podcastEpisodes.find((ep) => ep.id === id))
|
||||
console.log('Episodes in listening order', episodesInListeningOrder)
|
||||
// Sort the episodes based on the sorting and filtering from the episode table component
|
||||
const episodesInListeningOrder = this.sortedEpisodeIds.map((id) => this.podcastEpisodes.find((ep) => ep.id === id))
|
||||
|
||||
// Find most recent episode unplayed
|
||||
let episodeIndex = episodesInListeningOrder.findLastIndex((ep) => {
|
||||
// Find the first unplayed episode from the table
|
||||
let episodeIndex = episodesInListeningOrder.findIndex((ep) => {
|
||||
const podcastProgress = this.$store.getters['user/getUserMediaProgress'](this.libraryItemId, ep.id)
|
||||
return !podcastProgress || !podcastProgress.isFinished
|
||||
})
|
||||
// If all episodes are played, use the first episode
|
||||
if (episodeIndex < 0) episodeIndex = 0
|
||||
|
||||
episodeId = episodesInListeningOrder[episodeIndex].id
|
||||
|
Loading…
Reference in New Issue
Block a user