Browse Source

Merge pull request #855 from MemeCornucopia/orderFix

Fixed Sorting Shows
pull/856/head
William Oldham 2 years ago committed by GitHub
parent
commit
e9e2f3f470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      src/backend/accounts/user.ts

7
src/backend/accounts/user.ts

@ -87,6 +87,13 @@ export function progressResponsesToEntries(responses: ProgressResponse[]) { @@ -87,6 +87,13 @@ export function progressResponsesToEntries(responses: ProgressResponse[]) {
}
const item = items[v.tmdbId];
// 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();
}
if (item.type === "movie") {
item.progress = {
duration: Number(v.duration),

Loading…
Cancel
Save