mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-07 19:22:43 +02:00
Add download queue
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user