mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-02 13:34:53 +02:00
Fix:New authors not setting lastFirst column, updates for new Series model
This commit is contained in:
parent
7ff72a8920
commit
db86bfd63d
14 changed files with 234 additions and 225 deletions
|
@ -104,6 +104,9 @@ class AuthorController {
|
|||
let hasUpdated = false
|
||||
|
||||
const authorNameUpdate = payload.name !== undefined && payload.name !== req.author.name
|
||||
if (authorNameUpdate) {
|
||||
payload.lastFirst = Database.authorModel.getLastFirst(payload.name)
|
||||
}
|
||||
|
||||
// Check if author name matches another author and merge the authors
|
||||
let existingAuthor = null
|
||||
|
@ -169,6 +172,11 @@ class AuthorController {
|
|||
return
|
||||
}
|
||||
|
||||
// If lastFirst is not set, get it from the name
|
||||
if (!authorNameUpdate && !req.author.lastFirst) {
|
||||
payload.lastFirst = Database.authorModel.getLastFirst(req.author.name)
|
||||
}
|
||||
|
||||
// Regular author update
|
||||
req.author.set(payload)
|
||||
if (req.author.changed()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue