Add playbackRate to MediaProgress extraData for per-book playback speed #1173

This commit is contained in:
Eyad 2026-03-04 22:04:59 +00:00
parent 6d3404272c
commit 8bd99a459e

View file

@ -165,6 +165,7 @@ class MediaProgress extends Model {
hideFromContinueListening: !!this.hideFromContinueListening,
ebookLocation: this.ebookLocation,
ebookProgress: this.ebookProgress,
playbackRate: this.extraData?.playbackRate || null,
lastUpdate: this.updatedAt.valueOf(),
startedAt: this.createdAt.valueOf(),
finishedAt: this.finishedAt?.valueOf() || null
@ -205,6 +206,11 @@ class MediaProgress extends Model {
this.changed('extraData', true)
}
if (progressPayload.playbackRate !== undefined) {
this.extraData.playbackRate = progressPayload.playbackRate
this.changed('extraData', true)
}
this.set(progressPayload)
// Reset hideFromContinueListening if the progress has changed