mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-02 09:09:37 +00:00
Add published at to podcast episode row #428, Fix podcast select episodes, fix save order of podcast episode, fix remove podcast episode
This commit is contained in:
parent
c60807f998
commit
23cc6bb210
6 changed files with 63 additions and 33 deletions
|
|
@ -210,7 +210,7 @@ class LibraryItemController {
|
|||
}
|
||||
|
||||
// PATCH: api/items/:id/episodes
|
||||
async updateEpisodes(req, res) {
|
||||
async updateEpisodes(req, res) { // For updating podcast episode order
|
||||
var libraryItem = req.libraryItem
|
||||
var orderedFileData = req.body.episodes
|
||||
if (!libraryItem.media.setEpisodeOrder) {
|
||||
|
|
@ -227,7 +227,7 @@ class LibraryItemController {
|
|||
async removeEpisode(req, res) {
|
||||
var episodeId = req.params.episodeId
|
||||
var libraryItem = req.libraryItem
|
||||
if (!libraryItem.mediaType !== 'podcast') {
|
||||
if (libraryItem.mediaType !== 'podcast') {
|
||||
Logger.error(`[LibraryItemController] removeEpisode invalid media type ${libraryItem.id}`)
|
||||
return res.sendStatus(500)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ class Podcast {
|
|||
}
|
||||
|
||||
setEpisodeOrder(episodeIds) {
|
||||
episodeIds.reverse() // episode Ids will already be in descending order
|
||||
this.episodes = this.episodes.map(ep => {
|
||||
var indexOf = episodeIds.findIndex(id => id === ep.id)
|
||||
ep.index = indexOf + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue