Merge pull request #3615 from mikiher/fullupdatefromold-fix

Use a simpler database fetch in fullUpdateFromOld
This commit is contained in:
advplyr 2024-11-16 16:26:13 -06:00 committed by GitHub
commit bbe59499ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,35 +237,7 @@ class LibraryItem extends Model {
* @returns {Promise<boolean>} 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