audiobookshelf/server/controllers2/item.controller.js

18 lines
467 B
JavaScript
Raw Normal View History

2023-03-20 21:52:33 +01:00
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
}