mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-14 15:59:38 +00:00
Add download queue
This commit is contained in:
parent
f0edea5d52
commit
34ac972130
21 changed files with 359 additions and 22 deletions
|
|
@ -8,6 +8,7 @@ class PodcastEpisodeDownload {
|
|||
this.podcastEpisode = null
|
||||
this.url = null
|
||||
this.libraryItem = null
|
||||
this.libraryId = null
|
||||
|
||||
this.isAutoDownload = false
|
||||
this.isDownloading = false
|
||||
|
|
@ -25,12 +26,17 @@ class PodcastEpisodeDownload {
|
|||
episodeDisplayTitle: this.podcastEpisode ? this.podcastEpisode.title : null,
|
||||
url: this.url,
|
||||
libraryItemId: this.libraryItem ? this.libraryItem.id : null,
|
||||
libraryId: this.libraryId || null,
|
||||
isDownloading: this.isDownloading,
|
||||
isFinished: this.isFinished,
|
||||
failed: this.failed,
|
||||
startedAt: this.startedAt,
|
||||
createdAt: this.createdAt,
|
||||
finishedAt: this.finishedAt
|
||||
finishedAt: this.finishedAt,
|
||||
season: this.podcastEpisode ? this.podcastEpisode.season : null,
|
||||
episode: this.podcastEpisode ? this.podcastEpisode.episode : null,
|
||||
episodeType: this.podcastEpisode ? this.podcastEpisode.episodeType : 'full',
|
||||
publishedAt: this.podcastEpisode ? this.podcastEpisode.publishedAt : null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -47,13 +53,14 @@ class PodcastEpisodeDownload {
|
|||
return this.libraryItem ? this.libraryItem.id : null
|
||||
}
|
||||
|
||||
setData(podcastEpisode, libraryItem, isAutoDownload) {
|
||||
setData(podcastEpisode, libraryItem, isAutoDownload, libraryId) {
|
||||
this.id = getId('epdl')
|
||||
this.podcastEpisode = podcastEpisode
|
||||
this.url = encodeURI(podcastEpisode.enclosure.url)
|
||||
this.libraryItem = libraryItem
|
||||
this.isAutoDownload = isAutoDownload
|
||||
this.createdAt = Date.now()
|
||||
this.libraryId = libraryId
|
||||
}
|
||||
|
||||
setFinished(success) {
|
||||
|
|
@ -62,4 +69,4 @@ class PodcastEpisodeDownload {
|
|||
this.failed = !success
|
||||
}
|
||||
}
|
||||
module.exports = PodcastEpisodeDownload
|
||||
module.exports = PodcastEpisodeDownload
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue