mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-18 21:19:44 +00:00
Update libraryItem model to include libraryId
This commit is contained in:
parent
d745e6b656
commit
633e83a4ab
7 changed files with 161 additions and 4 deletions
24
server/db/library.db.js
Normal file
24
server/db/library.db.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue