From 22358112d337dff77623a9976f55ed8a8a32c1a5 Mon Sep 17 00:00:00 2001 From: MemeCornucopia <148788549+MemeCornucopia@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:13:11 -0500 Subject: [PATCH] Update src/backend/accounts/user.ts Co-authored-by: William Oldham --- src/backend/accounts/user.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/accounts/user.ts b/src/backend/accounts/user.ts index a6208d30..4708dd2b 100644 --- a/src/backend/accounts/user.ts +++ b/src/backend/accounts/user.ts @@ -87,7 +87,9 @@ export function progressResponsesToEntries(responses: ProgressResponse[]) { } const item = items[v.tmdbId]; - // Update the item only if the new update is more recent than the current one + + // Since each watched episode is a single array entry but with the same tmdbId, the root item updatedAt will only have the first episode's timestamp (which is not the newest). + // Here, we are setting it explicitly so the updatedAt always has the highest updatedAt from the episodes. if (new Date(v.updatedAt).getTime() > item.updatedAt) { item.updatedAt = new Date(v.updatedAt).getTime(); }