Fix startedAt in progress API

If no progress had been set before, setting `startedAt` did not work and
it would always been set to `finishedAt` or `Date.now()`. Settings this
if any progress had already been recorded did work.

This fixes the problem so that setting `startedAt` it properly works in
both cases.
This commit is contained in:
Lars Kiesow 2022-11-24 00:16:20 +01:00
parent 6af5ac2be1
commit 45434b16e0
No known key found for this signature in database
GPG Key ID: 5DAFE8D9C823CE73

View File

@ -68,7 +68,7 @@ class MediaProgress {
this.finishedAt = progress.finishedAt || Date.now()
this.progress = 1
}
this.startedAt = this.finishedAt || Date.now()
this.startedAt = progress.startedAt || this.finishedAt || Date.now()
}
update(payload) {