mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-12 05:24:25 +02:00
Update filterData for authors/series when added/removed
This commit is contained in:
@@ -83,6 +83,15 @@ class Author extends Model {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if author exists
|
||||
* @param {string} authorId
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
static async checkExistsById(authorId) {
|
||||
return (await this.count({ where: { id: authorId } })) > 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize model
|
||||
* @param {import('../Database').sequelize} sequelize
|
||||
|
||||
@@ -75,6 +75,15 @@ class Series extends Model {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if series exists
|
||||
* @param {string} seriesId
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
static async checkExistsById(seriesId) {
|
||||
return (await this.count({ where: { id: seriesId } })) > 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize model
|
||||
* @param {import('../Database').sequelize} sequelize
|
||||
|
||||
Reference in New Issue
Block a user