mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-02 17:24:57 +02:00
Show current episode download on init and download queue page updates
This commit is contained in:
parent
61c759e0c4
commit
022bf9d0ef
10 changed files with 74 additions and 74 deletions
|
@ -82,11 +82,9 @@ class LibraryController {
|
|||
return res.json(req.library)
|
||||
}
|
||||
|
||||
async getDownloadQueue(req, res) {
|
||||
const library = req.library
|
||||
|
||||
let queue = this.podcastManager.getDownloadQueueDetails().filter(q => q.libraryId === library.id)
|
||||
return res.json(queue)
|
||||
async getEpisodeDownloadQueue(req, res) {
|
||||
const libraryDownloadQueueDetails = this.podcastManager.getDownloadQueueDetails(req.library.id)
|
||||
return res.json(libraryDownloadQueueDetails)
|
||||
}
|
||||
|
||||
async update(req, res) {
|
||||
|
|
|
@ -36,8 +36,11 @@ class LibraryItemController {
|
|||
}).filter(au => au)
|
||||
}
|
||||
} else if (includeEntities.includes('downloads')) {
|
||||
var downloadsInQueue = this.podcastManager.getEpisodeDownloadsInQueue(req.libraryItem.id)
|
||||
item.episodesDownloading = downloadsInQueue.map(d => d.toJSONForClient())
|
||||
const downloadsInQueue = this.podcastManager.getEpisodeDownloadsInQueue(req.libraryItem.id)
|
||||
item.episodeDownloadsQueued = downloadsInQueue.map(d => d.toJSONForClient())
|
||||
if (this.podcastManager.currentDownload?.libraryItemId === req.libraryItem.id) {
|
||||
item.episodesDownloading = [this.podcastManager.currentDownload.toJSONForClient()]
|
||||
}
|
||||
}
|
||||
|
||||
return res.json(item)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue