mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-04 03:17:00 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			362 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			362 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const itemDb = require('../db/item.db')
 | 
						|
 | 
						|
const getLibraryItem = async (req, res) => {
 | 
						|
  let libraryItem = null
 | 
						|
  if (req.query.expanded == 1) {
 | 
						|
    libraryItem = await itemDb.getLibraryItemExpanded(req.params.id)
 | 
						|
  } else {
 | 
						|
    libraryItem = await itemDb.getLibraryItemMinified(req.params.id)
 | 
						|
  }
 | 
						|
 | 
						|
  res.json(libraryItem)
 | 
						|
}
 | 
						|
 | 
						|
module.exports = {
 | 
						|
  getLibraryItem
 | 
						|
} |