mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-04-24 14:37:14 -04:00
Remove old Author object & fix issue deleting empty authors
This commit is contained in:
parent
acc4bdbc5e
commit
ba742563c2
13 changed files with 227 additions and 314 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue