Skip to content

Commit

Permalink
Merge pull request #3615 from mikiher/fullupdatefromold-fix
Browse files Browse the repository at this point in the history
Use a simpler database fetch in fullUpdateFromOld
  • Loading branch information
advplyr authored Nov 16, 2024
2 parents 4c88e9c + 5ccf5d7 commit bbe5949
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions server/models/LibraryItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbe5949

Please sign in to comment.