mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-08-07 04:52:45 -04:00
Migrate to new library item in scanner
This commit is contained in:
1 parent
fdbca4feb6
commit
d5ce7b4939
21 files changed
+435
-845
No files matched your search
@@ -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