Add lastPlayedAt in watchlists & sort nextup with it

This commit is contained in:
Zoe Roux 2025-04-08 16:30:35 +02:00
parent d8566355bb
commit 67d7643261
No known key found for this signature in database
5 changed files with 1856 additions and 2 deletions

View File

@ -0,0 +1 @@
ALTER TABLE "kyoo"."watchlist" ADD COLUMN "last_played_at" timestamp with time zone;

File diff suppressed because it is too large Load Diff

View File

@ -134,6 +134,13 @@
"when": 1744053556621,
"tag": "0018_history",
"breakpoints": true
},
{
"idx": 19,
"version": "7",
"when": 1744120518941,
"tag": "0019_nextup",
"breakpoints": true
}
]
}

View File

@ -36,10 +36,10 @@ const nextupSort = Sort(
started: watchlist.startedAt,
added: watchlist.createdAt,
updated: watchlist.updatedAt,
lastPlayed: watchlist.lastPlayedAt,
},
{
default: ["updated"],
default: ["lastPlayed"],
tablePk: entries.pk,
},
);

View File

@ -30,6 +30,7 @@ export const watchlist = schema.table(
score: integer(),
startedAt: timestamp({ withTimezone: true, mode: "string" }),
lastPlayedAt: timestamp({ withTimezone: true, mode: "string" }),
completedAt: timestamp({ withTimezone: true, mode: "string" }),
createdAt: timestamp({ withTimezone: true, mode: "string" })