mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-19 00:18:56 +01:00
Fix:Server crash when updating media with external cover url that fails to download #2857
This commit is contained in:
parent
15f83986e7
commit
f74d741821
@ -117,16 +117,20 @@ class LibraryItemController {
|
|||||||
zipHelpers.zipDirectoryPipe(libraryItemPath, filename, res)
|
zipHelpers.zipDirectoryPipe(libraryItemPath, filename, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/**
|
||||||
// PATCH: will create new authors & series if in payload
|
* PATCH: /items/:id/media
|
||||||
//
|
* Update media for a library item. Will create new authors & series when necessary
|
||||||
|
*
|
||||||
|
* @param {import('express').Request} req
|
||||||
|
* @param {import('express').Response} res
|
||||||
|
*/
|
||||||
async updateMedia(req, res) {
|
async updateMedia(req, res) {
|
||||||
const libraryItem = req.libraryItem
|
const libraryItem = req.libraryItem
|
||||||
const mediaPayload = req.body
|
const mediaPayload = req.body
|
||||||
|
|
||||||
if (mediaPayload.url) {
|
if (mediaPayload.url) {
|
||||||
await LibraryItemController.prototype.uploadCover.bind(this)(req, res, false)
|
await LibraryItemController.prototype.uploadCover.bind(this)(req, res, false)
|
||||||
if (res.writableEnded) return
|
if (res.writableEnded || res.headersSent) return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Book specific
|
// Book specific
|
||||||
|
Loading…
Reference in New Issue
Block a user