Update:Remove item metadata path when removing item #1561

This commit is contained in:
advplyr 2023-04-16 16:23:13 -05:00
parent eb5f257b8c
commit e4961feffb

View File

@ -410,6 +410,12 @@ class ApiRouter {
await this.cacheManager.purgeCoverCache(libraryItem.id)
}
const itemMetadataPath = Path.join(global.MetadataPath, 'items', libraryItem.id)
if (await fs.pathExists(itemMetadataPath)) {
Logger.debug(`[ApiRouter] Removing item metadata path "${itemMetadataPath}"`)
await fs.remove(itemMetadataPath)
}
await this.db.removeLibraryItem(libraryItem.id)
SocketAuthority.emitter('item_removed', libraryItem.toJSONExpanded())
}