mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-19 07:08:41 +01:00
Add:Podcast auto-download option to delete an episode if it exceeds X max episodes to keep #903
This commit is contained in:
1 parent
2c0c53bbf1
commit
7a69afdcd9
6 files changed
+85
-14
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user