mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 07:14:52 +02:00
Fix:New authors not setting lastFirst column, updates for new Series model
This commit is contained in:
@ -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()) {
|
||||
|
Reference in New Issue
Block a user