mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix:Server crash when uploading or adding new podcast #3353
This commit is contained in:
parent
5b22d7430a
commit
fc276b330a
@ -44,7 +44,7 @@ class MiscController {
|
|||||||
const files = Object.values(req.files)
|
const files = Object.values(req.files)
|
||||||
const { title, author, series, folder: folderId, library: libraryId } = req.body
|
const { title, author, series, folder: folderId, library: libraryId } = req.body
|
||||||
|
|
||||||
const library = await Database.libraryModel.findByPk(libraryId)
|
const library = await Database.libraryModel.findByIdWithFolders(libraryId)
|
||||||
if (!library) {
|
if (!library) {
|
||||||
return res.status(404).send(`Library not found with id ${libraryId}`)
|
return res.status(404).send(`Library not found with id ${libraryId}`)
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class PodcastController {
|
|||||||
}
|
}
|
||||||
const payload = req.body
|
const payload = req.body
|
||||||
|
|
||||||
const library = await Database.libraryModel.findByPk(payload.libraryId)
|
const library = await Database.libraryModel.findByIdWithFolders(payload.libraryId)
|
||||||
if (!library) {
|
if (!library) {
|
||||||
Logger.error(`[PodcastController] Create: Library not found "${payload.libraryId}"`)
|
Logger.error(`[PodcastController] Create: Library not found "${payload.libraryId}"`)
|
||||||
return res.status(404).send('Library not found')
|
return res.status(404).send('Library not found')
|
||||||
|
Loading…
Reference in New Issue
Block a user