diff --git a/server/controllers/LibraryItemController.js b/server/controllers/LibraryItemController.js index 5ecd7c3b..dceed76e 100644 --- a/server/controllers/LibraryItemController.js +++ b/server/controllers/LibraryItemController.js @@ -100,6 +100,7 @@ class LibraryItemController { async updateMedia(req, res) { const libraryItem = req.libraryItem const mediaPayload = req.body + // Item has cover and update is removing cover so purge it from cache if (libraryItem.media.coverPath && (mediaPayload.coverPath === '' || mediaPayload.coverPath === null)) { await this.cacheManager.purgeCoverCache(libraryItem.id) diff --git a/server/models/LibraryItem.js b/server/models/LibraryItem.js index 74504347..4e200737 100644 --- a/server/models/LibraryItem.js +++ b/server/models/LibraryItem.js @@ -119,7 +119,7 @@ module.exports = (sequelize) => { { model: sequelize.models.series, through: { - attributes: ['sequence'] + attributes: ['id', 'sequence'] } } ] @@ -220,7 +220,7 @@ module.exports = (sequelize) => { hasUpdates = true } else if (existingSeriesMatch.bookSeries.sequence !== updatedSeries.sequence) { Logger.dev(`[LibraryItem] "${libraryItemExpanded.media.title}" series "${updatedSeries.name}" sequence was updated from "${existingSeriesMatch.bookSeries.sequence}" to "${updatedSeries.sequence}"`) - await existingSeriesMatch.bookSeries.update({ sequence: updatedSeries.sequence }) + await existingSeriesMatch.bookSeries.update({ id: updatedSeries.id, sequence: updatedSeries.sequence }) hasUpdates = true } }