mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-21 16:39:13 +02:00
Update library filter data to load from db and cache, update rss feed routes to load library items from db
This commit is contained in:
parent
8d03b23f46
commit
3651fffbee
13 changed files with 253 additions and 92 deletions
|
@ -99,15 +99,15 @@ class ToolsController {
|
|||
res.sendStatus(200)
|
||||
}
|
||||
|
||||
middleware(req, res, next) {
|
||||
async middleware(req, res, next) {
|
||||
if (!req.user.isAdminOrUp) {
|
||||
Logger.error(`[LibraryItemController] Non-root user attempted to access tools route`, req.user)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
if (req.params.id) {
|
||||
const item = Database.libraryItems.find(li => li.id === req.params.id)
|
||||
if (!item || !item.media) return res.sendStatus(404)
|
||||
const item = await Database.models.libraryItem.getOldById(req.params.id)
|
||||
if (!item?.media) return res.sendStatus(404)
|
||||
|
||||
// Check user can access this library item
|
||||
if (!req.user.checkCanAccessLibraryItem(item)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue