mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-24 20:59:38 +00:00
Add:Podcast auto-download option to delete an episode if it exceeds X max episodes to keep #903
This commit is contained in:
parent
2c0c53bbf1
commit
7a69afdcd9
6 changed files with 85 additions and 14 deletions
|
|
@ -19,6 +19,7 @@ class Podcast {
|
|||
|
||||
this.autoDownloadEpisodes = false
|
||||
this.lastEpisodeCheck = 0
|
||||
this.maxEpisodesToKeep = 0
|
||||
|
||||
this.lastCoverSearch = null
|
||||
this.lastCoverSearchQuery = null
|
||||
|
|
@ -40,6 +41,7 @@ class Podcast {
|
|||
})
|
||||
this.autoDownloadEpisodes = !!podcast.autoDownloadEpisodes
|
||||
this.lastEpisodeCheck = podcast.lastEpisodeCheck || 0
|
||||
this.maxEpisodesToKeep = podcast.maxEpisodesToKeep || 0
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
|
@ -50,7 +52,8 @@ class Podcast {
|
|||
tags: [...this.tags],
|
||||
episodes: this.episodes.map(e => e.toJSON()),
|
||||
autoDownloadEpisodes: this.autoDownloadEpisodes,
|
||||
lastEpisodeCheck: this.lastEpisodeCheck
|
||||
lastEpisodeCheck: this.lastEpisodeCheck,
|
||||
maxEpisodesToKeep: this.maxEpisodesToKeep
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,6 +65,7 @@ class Podcast {
|
|||
numEpisodes: this.episodes.length,
|
||||
autoDownloadEpisodes: this.autoDownloadEpisodes,
|
||||
lastEpisodeCheck: this.lastEpisodeCheck,
|
||||
maxEpisodesToKeep: this.maxEpisodesToKeep,
|
||||
size: this.size
|
||||
}
|
||||
}
|
||||
|
|
@ -75,6 +79,7 @@ class Podcast {
|
|||
episodes: this.episodes.map(e => e.toJSONExpanded()),
|
||||
autoDownloadEpisodes: this.autoDownloadEpisodes,
|
||||
lastEpisodeCheck: this.lastEpisodeCheck,
|
||||
maxEpisodesToKeep: this.maxEpisodesToKeep,
|
||||
size: this.size
|
||||
}
|
||||
}
|
||||
|
|
@ -113,6 +118,9 @@ class Podcast {
|
|||
})
|
||||
return largestPublishedAt
|
||||
}
|
||||
get episodesWithPubDate() {
|
||||
return this.episodes.filter(ep => !!ep.publishedAt)
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
var json = this.toJSON()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue