mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-11 23:32:49 +02:00
Merge pull request #4766 from TN-SKYC/Authors-bug
Bug in matching author of a book when this author already exists in the db.
This commit is contained in:
@@ -259,7 +259,7 @@ class Scanner {
|
|||||||
SocketAuthority.emitter('author_added', author.toOldJSON())
|
SocketAuthority.emitter('author_added', author.toOldJSON())
|
||||||
// Update filter data
|
// Update filter data
|
||||||
Database.addAuthorToFilterData(libraryItem.libraryId, author.name, author.id)
|
Database.addAuthorToFilterData(libraryItem.libraryId, author.name, author.id)
|
||||||
|
}
|
||||||
await Database.bookAuthorModel
|
await Database.bookAuthorModel
|
||||||
.create({
|
.create({
|
||||||
authorId: author.id,
|
authorId: author.id,
|
||||||
@@ -271,7 +271,6 @@ class Scanner {
|
|||||||
hasAuthorUpdates = true
|
hasAuthorUpdates = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const authorsRemoved = libraryItem.media.authors.filter((a) => !matchData.author.find((ma) => ma.toLowerCase() === a.name.toLowerCase()))
|
const authorsRemoved = libraryItem.media.authors.filter((a) => !matchData.author.find((ma) => ma.toLowerCase() === a.name.toLowerCase()))
|
||||||
if (authorsRemoved.length) {
|
if (authorsRemoved.length) {
|
||||||
for (const author of authorsRemoved) {
|
for (const author of authorsRemoved) {
|
||||||
|
|||||||
Reference in New Issue
Block a user