mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 09:51:37 +00:00
fix postgres media progress timestamp update
This commit is contained in:
parent
7f7e73e3af
commit
d5b509a9d7
1 changed files with 7 additions and 1 deletions
|
|
@ -253,7 +253,13 @@ class MediaProgress extends Model {
|
||||||
const escapedDate = this.sequelize.escape(new Date(progressPayload.lastUpdate))
|
const escapedDate = this.sequelize.escape(new Date(progressPayload.lastUpdate))
|
||||||
Logger.info(`[MediaProgress] Manually setting updatedAt to ${escapedDate} (media item ${this.mediaItemId})`)
|
Logger.info(`[MediaProgress] Manually setting updatedAt to ${escapedDate} (media item ${this.mediaItemId})`)
|
||||||
|
|
||||||
await this.sequelize.query(`UPDATE "mediaProgresses" SET "updatedAt" = ${escapedDate} WHERE "id" = '${this.id}'`)
|
await this.constructor.update(
|
||||||
|
{ updatedAt: new Date(progressPayload.lastUpdate) },
|
||||||
|
{
|
||||||
|
where: { id: this.id },
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
await this.reload()
|
await this.reload()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue