From 45434b16e03d43eda5ca88ebd946677aef71af2f Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Thu, 24 Nov 2022 00:16:20 +0100 Subject: [PATCH] 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. --- server/objects/user/MediaProgress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/objects/user/MediaProgress.js b/server/objects/user/MediaProgress.js index 159fca34..3c4b4ca3 100644 --- a/server/objects/user/MediaProgress.js +++ b/server/objects/user/MediaProgress.js @@ -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) {