mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Update:Some incorrect status codes returned from API
This commit is contained in:
parent
16cf5b5616
commit
7d569e1e3e
@ -437,7 +437,7 @@ class LibraryItemController {
|
|||||||
async openRSSFeed(req, res) {
|
async openRSSFeed(req, res) {
|
||||||
if (!req.user.isAdminOrUp) {
|
if (!req.user.isAdminOrUp) {
|
||||||
Logger.error(`[LibraryItemController] Non-admin user attempted to open RSS feed`, req.user.username)
|
Logger.error(`[LibraryItemController] Non-admin user attempted to open RSS feed`, req.user.username)
|
||||||
return res.sendStatus(500)
|
return res.sendStatus(403)
|
||||||
}
|
}
|
||||||
|
|
||||||
const feedData = await this.rssFeedManager.openFeedForItem(req.user, req.libraryItem, req.body)
|
const feedData = await this.rssFeedManager.openFeedForItem(req.user, req.libraryItem, req.body)
|
||||||
@ -457,7 +457,7 @@ class LibraryItemController {
|
|||||||
async closeRSSFeed(req, res) {
|
async closeRSSFeed(req, res) {
|
||||||
if (!req.user.isAdminOrUp) {
|
if (!req.user.isAdminOrUp) {
|
||||||
Logger.error(`[LibraryItemController] Non-admin user attempted to close RSS feed`, req.user.username)
|
Logger.error(`[LibraryItemController] Non-admin user attempted to close RSS feed`, req.user.username)
|
||||||
return res.sendStatus(500)
|
return res.sendStatus(403)
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.rssFeedManager.closeFeedForItem(req.params.id)
|
await this.rssFeedManager.closeFeedForItem(req.params.id)
|
||||||
|
@ -56,18 +56,18 @@ class CacheManager {
|
|||||||
stream.pipeline(r, ps, (err) => {
|
stream.pipeline(r, ps, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
return res.sendStatus(400)
|
return res.sendStatus(500)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return ps.pipe(res)
|
return ps.pipe(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!libraryItem.media.coverPath || !await fs.pathExists(libraryItem.media.coverPath)) {
|
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)
|
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
|
// Set owner and permissions of cache image
|
||||||
await filePerms.setDefault(path)
|
await filePerms.setDefault(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user