From 5ccf5d7150bb94319987070ba10652b93cdbcab2 Mon Sep 17 00:00:00 2001 From: mikiher Date: Sat, 16 Nov 2024 06:26:32 +0200 Subject: [PATCH] Use a simpler database fetch in fullUpdateFromOld --- server/models/LibraryItem.js | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/server/models/LibraryItem.js b/server/models/LibraryItem.js index 17c3b12586..e867a96a8b 100644 --- a/server/models/LibraryItem.js +++ b/server/models/LibraryItem.js @@ -237,35 +237,7 @@ class LibraryItem extends Model { * @returns {Promise} true if updates were made */ static async fullUpdateFromOld(oldLibraryItem) { - const libraryItemExpanded = await this.findByPk(oldLibraryItem.id, { - include: [ - { - model: this.sequelize.models.book, - include: [ - { - model: this.sequelize.models.author, - through: { - attributes: [] - } - }, - { - model: this.sequelize.models.series, - through: { - attributes: ['id', 'sequence'] - } - } - ] - }, - { - model: this.sequelize.models.podcast, - include: [ - { - model: this.sequelize.models.podcastEpisode - } - ] - } - ] - }) + const libraryItemExpanded = await this.getExpandedById(oldLibraryItem.id) if (!libraryItemExpanded) return false let hasUpdates = false