mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-11 07:12:45 +02:00
Add ignoreDuplicates for bookAuthor when renaming to respect unique index
This commit is contained in:
@@ -149,7 +149,7 @@ class AuthorController {
|
|||||||
})
|
})
|
||||||
if (libraryItems.length) {
|
if (libraryItems.length) {
|
||||||
await Database.bookAuthorModel.removeByIds(req.author.id) // Remove all old BookAuthor
|
await Database.bookAuthorModel.removeByIds(req.author.id) // Remove all old BookAuthor
|
||||||
await Database.bookAuthorModel.bulkCreate(bookAuthorsToCreate) // Create all new BookAuthor
|
await Database.bookAuthorModel.bulkCreate(bookAuthorsToCreate, { ignoreDuplicates: true }) // Create all new unique BookAuthor
|
||||||
for (const libraryItem of libraryItems) {
|
for (const libraryItem of libraryItems) {
|
||||||
await libraryItem.saveMetadataFile()
|
await libraryItem.saveMetadataFile()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user