mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-28 01:52:27 -04:00
Rename criticalToStory to content enum
This commit is contained in:
@@ -198,7 +198,7 @@ async function updateWatchlist(
|
||||
and(
|
||||
eq(nextEntry.showPk, entries.showPk),
|
||||
ne(nextEntry.kind, "extra"),
|
||||
nextEntry.criticalToStory,
|
||||
eq(nextEntry.content, "story"),
|
||||
gt(nextEntry.order, entries.order),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -96,6 +96,7 @@ export const seedMovie = async (
|
||||
{
|
||||
...movie,
|
||||
kind: "movie",
|
||||
content: "story",
|
||||
order: 1,
|
||||
thumbnail: (movie.originalLanguage
|
||||
? translations[movie.originalLanguage]
|
||||
|
||||
@@ -277,7 +277,7 @@ function getNextVideoEntry({
|
||||
eq(vids.part, sql`${videos.part} ${sql.raw(prev ? "-" : "+")} 1`),
|
||||
),
|
||||
),
|
||||
entries.criticalToStory,
|
||||
eq(entries.content, "story"),
|
||||
),
|
||||
)
|
||||
.orderBy(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { relations, sql } from "drizzle-orm";
|
||||
import {
|
||||
boolean,
|
||||
check,
|
||||
date,
|
||||
index,
|
||||
@@ -25,6 +24,13 @@ export const entryType = schema.enum("entry_type", [
|
||||
"extra",
|
||||
]);
|
||||
|
||||
export const entryContent = schema.enum("entry_content", [
|
||||
"story",
|
||||
"recap",
|
||||
"filler",
|
||||
"ova",
|
||||
]);
|
||||
|
||||
export const entry_extid = () =>
|
||||
jsonb()
|
||||
.$type<
|
||||
@@ -69,7 +75,7 @@ export const entries = schema.table(
|
||||
airDate: date(),
|
||||
runtime: integer(),
|
||||
thumbnail: image(),
|
||||
criticalToStory: boolean().notNull(),
|
||||
content: entryContent().notNull(),
|
||||
|
||||
externalId: entry_extid(),
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { t } from "elysia";
|
||||
import { Image } from "../utils/image";
|
||||
|
||||
export const EntryContent = t.Union([
|
||||
t.Literal("story"),
|
||||
t.Literal("recap"),
|
||||
t.Literal("filler"),
|
||||
t.Literal("ova"),
|
||||
]);
|
||||
|
||||
export const BaseEntry = () =>
|
||||
t.Object({
|
||||
airDate: t.Nullable(t.String({ format: "date" })),
|
||||
@@ -11,7 +18,7 @@ export const BaseEntry = () =>
|
||||
}),
|
||||
),
|
||||
thumbnail: t.Nullable(Image),
|
||||
criticalToStory: t.Boolean(),
|
||||
content: EntryContent,
|
||||
});
|
||||
|
||||
export const EntryTranslation = () =>
|
||||
|
||||
@@ -22,7 +22,7 @@ export const BaseExtra = t.Composite(
|
||||
kind: ExtraType,
|
||||
name: t.String(),
|
||||
}),
|
||||
t.Omit(BaseEntry(), ["nextRefresh", "airDate"]),
|
||||
t.Omit(BaseEntry(), ["nextRefresh", "airDate", "content"]),
|
||||
],
|
||||
{
|
||||
description: comment`
|
||||
|
||||
@@ -175,6 +175,7 @@ export const madeInAbyss = {
|
||||
entries: [
|
||||
{
|
||||
kind: "episode",
|
||||
content: "story",
|
||||
order: 13,
|
||||
seasonNumber: 1,
|
||||
episodeNumber: 13,
|
||||
@@ -203,6 +204,7 @@ export const madeInAbyss = {
|
||||
},
|
||||
{
|
||||
kind: "special",
|
||||
content: "ova",
|
||||
// between s1e13 & movie (which has 13.5 for the `order field`)
|
||||
order: 13.25,
|
||||
number: 3,
|
||||
@@ -230,6 +232,7 @@ export const madeInAbyss = {
|
||||
},
|
||||
{
|
||||
kind: "movie",
|
||||
content: "story",
|
||||
slug: "made-in-abyss-dawn-of-the-deep-soul",
|
||||
order: 13.5,
|
||||
translations: {
|
||||
@@ -257,6 +260,7 @@ export const madeInAbyss = {
|
||||
},
|
||||
{
|
||||
kind: "episode",
|
||||
content: "story",
|
||||
order: 14,
|
||||
seasonNumber: 2,
|
||||
episodeNumber: 1,
|
||||
@@ -284,6 +288,7 @@ export const madeInAbyss = {
|
||||
},
|
||||
{
|
||||
kind: "episode",
|
||||
content: "story",
|
||||
order: 15,
|
||||
seasonNumber: 2,
|
||||
episodeNumber: 2,
|
||||
@@ -311,6 +316,7 @@ export const madeInAbyss = {
|
||||
},
|
||||
{
|
||||
kind: "episode",
|
||||
content: "story",
|
||||
order: 16,
|
||||
seasonNumber: 2,
|
||||
episodeNumber: 3,
|
||||
@@ -338,6 +344,7 @@ export const madeInAbyss = {
|
||||
},
|
||||
{
|
||||
kind: "episode",
|
||||
content: "story",
|
||||
order: 17,
|
||||
seasonNumber: 2,
|
||||
episodeNumber: 4,
|
||||
|
||||
Reference in New Issue
Block a user