mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-24 21:15:28 +02:00
Remove old Author object & fix issue deleting empty authors
This commit is contained in:
@@ -73,8 +73,7 @@ module.exports = {
|
||||
})
|
||||
const authorMatches = []
|
||||
for (const author of authors) {
|
||||
const oldAuthor = author.getOldAuthor().toJSON()
|
||||
oldAuthor.numBooks = author.dataValues.numBooks
|
||||
const oldAuthor = author.toOldJSONExpanded(author.dataValues.numBooks)
|
||||
authorMatches.push(oldAuthor)
|
||||
}
|
||||
return authorMatches
|
||||
|
@@ -353,7 +353,7 @@ module.exports = {
|
||||
return {
|
||||
authors: authors.map((au) => {
|
||||
const numBooks = au.books.length || 0
|
||||
return au.getOldAuthor().toJSONExpanded(numBooks)
|
||||
return au.toOldJSONExpanded(numBooks)
|
||||
}),
|
||||
count
|
||||
}
|
||||
@@ -409,7 +409,7 @@ module.exports = {
|
||||
|
||||
/**
|
||||
* Get library items for an author, optional use user permissions
|
||||
* @param {oldAuthor} author
|
||||
* @param {import('../../models/Author')} author
|
||||
* @param {import('../../models/User')} user
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
|
Reference in New Issue
Block a user