mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-04-07 09:41:56 -04:00
Fix nextup profile mismatch (#1430)
This commit is contained in:
parent
a27fd847c9
commit
52dfacf8db
@ -428,8 +428,8 @@ export const historyH = new Elysia({ tags: ["profiles"] })
|
||||
query,
|
||||
sort,
|
||||
filter: and(
|
||||
isNotNull(entryProgressQ.playedDate),
|
||||
eq(entryProgressQ.external, false),
|
||||
isNotNull(historyProgressQ.playedDate),
|
||||
eq(historyProgressQ.external, false),
|
||||
ne(entries.kind, "extra"),
|
||||
filter,
|
||||
),
|
||||
|
||||
@ -2,7 +2,7 @@ import { and, eq, isNotNull, lt, or, sql } from "drizzle-orm";
|
||||
import Elysia, { t } from "elysia";
|
||||
import { auth } from "~/auth";
|
||||
import { db } from "~/db";
|
||||
import { entries } from "~/db/schema";
|
||||
import { entries, profiles } from "~/db/schema";
|
||||
import { watchlist } from "~/db/schema/watchlist";
|
||||
import { getColumns } from "~/db/utils";
|
||||
import { Entry } from "~/models/entry";
|
||||
@ -113,11 +113,13 @@ export const nextup = new Elysia({ tags: ["profiles"] })
|
||||
})
|
||||
.from(entries)
|
||||
.innerJoin(watchlist, eq(watchlist.nextEntry, entries.pk))
|
||||
.innerJoin(profiles, eq(watchlist.profilePk, profiles.pk))
|
||||
.innerJoin(transQ, eq(entries.pk, transQ.pk))
|
||||
.crossJoinLateral(entryVideosQ)
|
||||
.leftJoin(entryProgressQ, eq(entries.pk, entryProgressQ.entryPk))
|
||||
.where(
|
||||
and(
|
||||
eq(profiles.id, sub),
|
||||
or(
|
||||
lt(entries.airDate, sql`now()`),
|
||||
isNotNull(entries.availableSince),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user