Add:Remove all chapters button in chapter editor #1603

This commit is contained in:
advplyr 2023-04-09 12:47:36 -05:00
parent 3656eab8bf
commit 5e5b674c17
12 changed files with 58 additions and 8 deletions

View file

@ -436,12 +436,12 @@ class LibraryItemController {
return res.sendStatus(500)
}
const chapters = req.body.chapters || []
if (!chapters.length) {
if (!req.body.chapters) {
Logger.error(`[LibraryItemController] Invalid payload`)
return res.sendStatus(400)
}
const chapters = req.body.chapters || []
const wasUpdated = req.libraryItem.media.updateChapters(chapters)
if (wasUpdated) {
await this.db.updateLibraryItem(req.libraryItem)