Skip to content

Commit

Permalink
Use a simpler database fetch in fullUpdateFromOld
Browse files Browse the repository at this point in the history
  • Loading branch information
mikiher committed Nov 16, 2024
1 parent 2a62992 commit 5ccf5d7
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 5ccf5d7

Please sign in to comment.