Update:Remove manual sorting of podcast episodes and default to sort by published at

This commit is contained in:
advplyr 2022-05-23 19:28:00 -05:00
parent 3c465994fe
commit 3e98b6f749
7 changed files with 23 additions and 136 deletions

View file

@ -224,18 +224,10 @@ class Podcast {
this.episodes.push(pe)
}
setEpisodeOrder(episodeIds) {
episodeIds.reverse() // episode Ids will already be in descending order
this.episodes = this.episodes.map(ep => {
var indexOf = episodeIds.findIndex(id => id === ep.id)
ep.index = indexOf + 1
return ep
})
this.episodes.sort((a, b) => b.index - a.index)
}
reorderEpisodes() {
var hasUpdates = false
// TODO: Sort by published date
this.episodes = naturalSort(this.episodes).asc((ep) => ep.bestFilename)
for (let i = 0; i < this.episodes.length; i++) {
if (this.episodes[i].index !== (i + 1)) {