mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-17 08:29:37 +00:00
Update:Some incorrect status codes returned from API
This commit is contained in:
parent
16cf5b5616
commit
7d569e1e3e
2 changed files with 5 additions and 5 deletions
|
|
@ -56,18 +56,18 @@ class CacheManager {
|
|||
stream.pipeline(r, ps, (err) => {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
return res.sendStatus(400)
|
||||
return res.sendStatus(500)
|
||||
}
|
||||
})
|
||||
return ps.pipe(res)
|
||||
}
|
||||
|
||||
if (!libraryItem.media.coverPath || !await fs.pathExists(libraryItem.media.coverPath)) {
|
||||
return res.sendStatus(404)
|
||||
return res.sendStatus(500)
|
||||
}
|
||||
|
||||
let writtenFile = await resizeImage(libraryItem.media.coverPath, path, width, height)
|
||||
if (!writtenFile) return res.sendStatus(400)
|
||||
if (!writtenFile) return res.sendStatus(500)
|
||||
|
||||
// Set owner and permissions of cache image
|
||||
await filePerms.setDefault(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue