mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-24 04:39:40 +00:00
Update view feed modal to sort episodes by pub date ascending
This commit is contained in:
parent
ed3af5bdcd
commit
39567c6c22
1 changed files with 10 additions and 1 deletions
|
|
@ -137,7 +137,16 @@ export default {
|
|||
this.$toast.error(this.$strings.ToastFailedToLoadData)
|
||||
return
|
||||
}
|
||||
this.feeds = data.feeds
|
||||
this.feeds = data.feeds.map((feed) => ({
|
||||
...feed,
|
||||
episodes: [...feed.episodes].sort((a, b) => {
|
||||
if (!a.pubDate) return 1 // null dates sort to end
|
||||
if (!b.pubDate) return -1
|
||||
const dateA = new Date(a.pubDate)
|
||||
const dateB = new Date(b.pubDate)
|
||||
return dateA - dateB
|
||||
})
|
||||
}))
|
||||
},
|
||||
init() {
|
||||
this.loadFeeds()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue