mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-06 06:56:27 +01:00
Update author API endpoints to load library items from DB
This commit is contained in:
1 parent
56e3449db6
commit
345ff1aa66
5 files changed
+80
-22
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user