mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-29 04:00:32 +02:00
Update MeController api endpoints to load library items from DB
This commit is contained in:
parent
db80cec168
commit
f1130eb63a
4 changed files with 56 additions and 32 deletions
|
@ -678,6 +678,15 @@ module.exports = (sequelize) => {
|
|||
return libraryItems.map(li => this.getOldLibraryItem(li))
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if library item exists
|
||||
* @param {string} libraryItemId
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
static async checkExistsById(libraryItemId) {
|
||||
return (await this.count({ where: { id: libraryItemId } })) > 0
|
||||
}
|
||||
|
||||
getMedia(options) {
|
||||
if (!this.mediaType) return Promise.resolve(null)
|
||||
const mixinMethodName = `get${sequelize.uppercaseFirst(this.mediaType)}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue