mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
Update routes/controllers/db structure
This commit is contained in:
parent
258b9ec54e
commit
b62e88c4ed
7 changed files with 306 additions and 282 deletions
18
server/controllers2/item.controller.js
Normal file
18
server/controllers2/item.controller.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const itemDb = require('../db/item.db')
|
||||
|
||||
const getLibraryItem = async (req, res) => {
|
||||
let libraryItem = null
|
||||
if (req.query.minified == 1) {
|
||||
libraryItem = await itemDb.getLibraryItemMinified(req.params.id)
|
||||
} else if (req.query.expanded == 1) {
|
||||
libraryItem = await itemDb.getLibraryItemExpanded(req.params.id)
|
||||
} else {
|
||||
libraryItem = await itemDb.getLibraryItemFull(req.params.id)
|
||||
}
|
||||
|
||||
res.json(libraryItem)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getLibraryItem
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue