mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-04-01 06:42:24 -04:00
Fix /api/videos/:id?with=show's watchlist date formats
This commit is contained in:
parent
b03cb757f4
commit
452e4f32b4
@ -318,11 +318,16 @@ const videoRelations = {
|
||||
)
|
||||
.as("t");
|
||||
|
||||
const { startedAt, lastPlayedAt, completedAt, ...watchlistCols } =
|
||||
getColumns(watchlist);
|
||||
const watchStatusQ = db
|
||||
.select({
|
||||
watchStatus: jsonbBuildObject<MovieWatchStatus & SerieWatchStatus>({
|
||||
...getColumns(watchlist),
|
||||
...watchlistCols,
|
||||
percent: watchlist.seenCount,
|
||||
startedAt: sql<string>`to_char(${startedAt}, 'YYYY-MM-DD"T"HH24:MI:SS"Z"')`,
|
||||
lastPlayedAt: sql<string>`to_char(${lastPlayedAt}, 'YYYY-MM-DD"T"HH24:MI:SS"Z"')`,
|
||||
completedAt: sql<string>`to_char(${completedAt}, 'YYYY-MM-DD"T"HH24:MI:SS"Z"')`,
|
||||
}).as("watchStatus"),
|
||||
})
|
||||
.from(watchlist)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user