Rename criticalToStory to content enum

This commit is contained in:
Zoe Roux
2026-04-03 19:26:21 +02:00
parent c7003d4bd8
commit d1aeadacee
15 changed files with 62 additions and 22 deletions
+1 -1
View File
@@ -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),
),
)
+1
View File
@@ -96,6 +96,7 @@ export const seedMovie = async (
{
...movie,
kind: "movie",
content: "story",
order: 1,
thumbnail: (movie.originalLanguage
? translations[movie.originalLanguage]
+1 -1
View File
@@ -277,7 +277,7 @@ function getNextVideoEntry({
eq(vids.part, sql`${videos.part} ${sql.raw(prev ? "-" : "+")} 1`),
),
),
entries.criticalToStory,
eq(entries.content, "story"),
),
)
.orderBy(
+8 -2
View File
@@ -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(),
+8 -1
View File
@@ -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 = () =>
+1 -1
View File
@@ -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`
+7
View File
@@ -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,