Add:Podcast auto-download option to delete an episode if it exceeds X max episodes to keep #903

This commit is contained in:
advplyr 2022-08-15 17:35:13 -05:00
parent 2c0c53bbf1
commit 7a69afdcd9
6 changed files with 85 additions and 14 deletions

View file

@ -9,6 +9,7 @@ class PodcastEpisodeDownload {
this.url = null
this.libraryItem = null
this.isAutoDownload = false
this.isDownloading = false
this.isFinished = false
this.failed = false
@ -46,11 +47,12 @@ class PodcastEpisodeDownload {
return this.libraryItem ? this.libraryItem.id : null
}
setData(podcastEpisode, libraryItem) {
setData(podcastEpisode, libraryItem, isAutoDownload) {
this.id = getId('epdl')
this.podcastEpisode = podcastEpisode
this.url = podcastEpisode.enclosure.url
this.libraryItem = libraryItem
this.isAutoDownload = isAutoDownload
this.createdAt = Date.now()
}