mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-18 17:31:31 +00:00
Add playbackRate to MediaProgress extraData for per-book playback speed #1173
This commit is contained in:
parent
47ea6b5092
commit
419aa4f2cc
1 changed files with 7 additions and 0 deletions
|
|
@ -169,6 +169,7 @@ class MediaProgress extends Model {
|
||||||
hideFromContinueListening: !!this.hideFromContinueListening,
|
hideFromContinueListening: !!this.hideFromContinueListening,
|
||||||
ebookLocation: this.ebookLocation,
|
ebookLocation: this.ebookLocation,
|
||||||
ebookProgress: this.ebookProgress,
|
ebookProgress: this.ebookProgress,
|
||||||
|
playbackRate: this.extraData?.playbackRate || null,
|
||||||
lastUpdate: this.updatedAt.valueOf(),
|
lastUpdate: this.updatedAt.valueOf(),
|
||||||
startedAt: this.createdAt.valueOf(),
|
startedAt: this.createdAt.valueOf(),
|
||||||
finishedAt: this.finishedAt?.valueOf() || null
|
finishedAt: this.finishedAt?.valueOf() || null
|
||||||
|
|
@ -209,6 +210,12 @@ class MediaProgress extends Model {
|
||||||
this.changed('extraData', true)
|
this.changed('extraData', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (progressPayload.playbackRate !== undefined) {
|
||||||
|
this.extraData.playbackRate = progressPayload.playbackRate
|
||||||
|
this.changed('extraData', true)
|
||||||
|
delete progressPayload.playbackRate
|
||||||
|
}
|
||||||
|
|
||||||
this.set(progressPayload)
|
this.set(progressPayload)
|
||||||
|
|
||||||
// Reset hideFromContinueListening if the progress has changed
|
// Reset hideFromContinueListening if the progress has changed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue