mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 15:24:55 +02:00
Migrate to new library item in scanner
This commit is contained in:
@ -242,8 +242,18 @@ class AuthorController {
|
||||
await CacheManager.purgeImageCache(req.author.id) // Purge cache
|
||||
}
|
||||
|
||||
// Load library items so that metadata file can be updated
|
||||
const allItemsWithAuthor = await Database.authorModel.getAllLibraryItemsForAuthor(req.author.id)
|
||||
allItemsWithAuthor.forEach((libraryItem) => {
|
||||
libraryItem.media.authors = libraryItem.media.authors.filter((au) => au.id !== req.author.id)
|
||||
})
|
||||
|
||||
await req.author.destroy()
|
||||
|
||||
for (const libraryItem of allItemsWithAuthor) {
|
||||
await libraryItem.saveMetadataFile()
|
||||
}
|
||||
|
||||
SocketAuthority.emitter('author_removed', req.author.toOldJSON())
|
||||
|
||||
// Update filter data
|
||||
|
Reference in New Issue
Block a user