mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
24 lines
477 B
JavaScript
24 lines
477 B
JavaScript
|
const Database = require('../Database')
|
||
|
|
||
|
const getAllLibraries = () => {
|
||
|
return Database.models.library.findAll({
|
||
|
include: {
|
||
|
model: Database.models.librarySetting,
|
||
|
attributes: ['key', 'value']
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
|
||
|
const getLibrary = (libraryId) => {
|
||
|
return Database.models.library.findByPk(libraryId, {
|
||
|
include: {
|
||
|
model: Database.models.librarySetting,
|
||
|
attributes: ['key', 'value']
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
getAllLibraries,
|
||
|
getLibrary
|
||
|
}
|