Merge pull request #1581 from mfcar/improvePodcastEditing

Improve podcast editing
This commit is contained in:
advplyr 2023-03-05 12:28:12 -06:00 committed by GitHub
commit aef2c52630
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 194 additions and 30 deletions

View file

@ -225,6 +225,20 @@ class PodcastController {
res.json(libraryItem.toJSONExpanded())
}
// GET: api/podcasts/:id/episode/:episodeId
async getEpisode(req, res) {
const episodeId = req.params.episodeId
const libraryItem = req.libraryItem
const episode = libraryItem.media.episodes.find(ep => ep.id === episodeId)
if (!episode) {
Logger.error(`[PodcastController] getEpisode episode ${episodeId} not found for item ${libraryItem.id}`)
return res.sendStatus(404)
}
res.json(episode)
}
// DELETE: api/podcasts/:id/episode/:episodeId
async removeEpisode(req, res) {
var episodeId = req.params.episodeId
@ -283,4 +297,4 @@ class PodcastController {
next()
}
}
module.exports = new PodcastController()
module.exports = new PodcastController()