mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-06 19:25:50 +02:00
Update author API endpoints to load library items from DB
This commit is contained in:
parent
56e3449db6
commit
345ff1aa66
5 changed files with 80 additions and 22 deletions
|
@ -679,8 +679,8 @@ class LibraryItemController {
|
|||
res.sendStatus(200)
|
||||
}
|
||||
|
||||
middleware(req, res, next) {
|
||||
req.libraryItem = Database.libraryItems.find(li => li.id === req.params.id)
|
||||
async middleware(req, res, next) {
|
||||
req.libraryItem = await Database.models.libraryItem.getOldById(req.params.id)
|
||||
if (!req.libraryItem?.media) return res.sendStatus(404)
|
||||
|
||||
// Check user can access this library item
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue