mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-08-15 18:45:24 +00:00
Fix available since not set
This commit is contained in:
@@ -92,6 +92,7 @@ export const insertEntries = record(
|
||||
"id",
|
||||
"slug",
|
||||
"createdAt",
|
||||
"availableSince",
|
||||
]),
|
||||
})
|
||||
.returning({ pk: entries.pk, id: entries.id, slug: entries.slug });
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
import { and, desc, eq, exists, ne, or, type SQL, sql } from "drizzle-orm";
|
||||
import {
|
||||
and,
|
||||
desc,
|
||||
eq,
|
||||
exists,
|
||||
isNotNull,
|
||||
ne,
|
||||
or,
|
||||
type SQL,
|
||||
sql,
|
||||
} from "drizzle-orm";
|
||||
import { alias } from "drizzle-orm/pg-core";
|
||||
import { db } from "~/db";
|
||||
import {
|
||||
@@ -269,7 +279,13 @@ export const showRelations = {
|
||||
.innerJoin(transQ, eq(entries.pk, transQ.pk))
|
||||
.leftJoin(entryProgressQ, eq(entries.pk, entryProgressQ.entryPk))
|
||||
.crossJoinLateral(entryVideosQ)
|
||||
.where(and(eq(entries.showPk, shows.pk), ne(entries.kind, "extra")))
|
||||
.where(
|
||||
and(
|
||||
eq(entries.showPk, shows.pk),
|
||||
ne(entries.kind, "extra"),
|
||||
isNotNull(entries.availableSince),
|
||||
),
|
||||
)
|
||||
.orderBy(entries.order)
|
||||
.limit(1)
|
||||
.as("firstEntry");
|
||||
|
||||
@@ -460,7 +460,7 @@ export const Header = ({
|
||||
: null
|
||||
}
|
||||
displayNumber={
|
||||
data.kind === "serie"
|
||||
data.kind === "serie" && (data.nextEntry ?? data.firstEntry)
|
||||
? entryDisplayNumber(data.nextEntry ?? data.firstEntry!)
|
||||
: null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user