mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-23 10:39:40 +00:00
Fix updating author name merging with same name authors in a different library #4628
This commit is contained in:
parent
fa5fa7b788
commit
6e0da3bf7a
1 changed files with 3 additions and 2 deletions
|
|
@ -113,7 +113,7 @@ class AuthorController {
|
||||||
payload.lastFirst = Database.authorModel.getLastFirst(payload.name)
|
payload.lastFirst = Database.authorModel.getLastFirst(payload.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if author name matches another author and merge the authors
|
// Check if author name matches another author in the same library and merge the authors
|
||||||
let existingAuthor = null
|
let existingAuthor = null
|
||||||
if (authorNameUpdate) {
|
if (authorNameUpdate) {
|
||||||
existingAuthor = await Database.authorModel.findOne({
|
existingAuthor = await Database.authorModel.findOne({
|
||||||
|
|
@ -121,7 +121,8 @@ class AuthorController {
|
||||||
id: {
|
id: {
|
||||||
[sequelize.Op.not]: req.author.id
|
[sequelize.Op.not]: req.author.id
|
||||||
},
|
},
|
||||||
name: payload.name
|
name: payload.name,
|
||||||
|
libraryId: req.author.libraryId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue