mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 12:14:46 -04:00
Dont send videos with extras
This commit is contained in:
parent
e86ab9c081
commit
fd2f3be663
@ -3,7 +3,6 @@ import { type Prettify, comment } from "~/utils";
|
|||||||
import { madeInAbyss, registerExamples } from "../examples";
|
import { madeInAbyss, registerExamples } from "../examples";
|
||||||
import { DbMetadata, SeedImage } from "../utils";
|
import { DbMetadata, SeedImage } from "../utils";
|
||||||
import { Resource } from "../utils/resource";
|
import { Resource } from "../utils/resource";
|
||||||
import { EmbeddedVideo } from "../video";
|
|
||||||
import { BaseEntry } from "./base-entry";
|
import { BaseEntry } from "./base-entry";
|
||||||
|
|
||||||
export const ExtraType = t.UnionEnum([
|
export const ExtraType = t.UnionEnum([
|
||||||
@ -32,14 +31,7 @@ export const BaseExtra = t.Intersect(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const Extra = t.Intersect([
|
export const Extra = t.Intersect([Resource(), BaseExtra, DbMetadata]);
|
||||||
Resource(),
|
|
||||||
BaseExtra,
|
|
||||||
t.Object({
|
|
||||||
video: t.Optional(EmbeddedVideo),
|
|
||||||
}),
|
|
||||||
DbMetadata,
|
|
||||||
]);
|
|
||||||
export type Extra = Prettify<typeof Extra.static>;
|
export type Extra = Prettify<typeof Extra.static>;
|
||||||
|
|
||||||
export const SeedExtra = t.Intersect([
|
export const SeedExtra = t.Intersect([
|
||||||
@ -52,4 +44,4 @@ export const SeedExtra = t.Intersect([
|
|||||||
]);
|
]);
|
||||||
export type SeedExtra = Prettify<typeof SeedExtra.static>;
|
export type SeedExtra = Prettify<typeof SeedExtra.static>;
|
||||||
|
|
||||||
registerExamples(Extra, { ...madeInAbyss.extras[0], video: undefined });
|
registerExamples(Extra, madeInAbyss.extras[0]);
|
||||||
|
@ -2,7 +2,6 @@ import { t } from "elysia";
|
|||||||
import { type Prettify, comment } from "~/utils";
|
import { type Prettify, comment } from "~/utils";
|
||||||
import { bubbleImages, registerExamples, youtubeExample } from "../examples";
|
import { bubbleImages, registerExamples, youtubeExample } from "../examples";
|
||||||
import { DbMetadata, Resource } from "../utils";
|
import { DbMetadata, Resource } from "../utils";
|
||||||
import { EmbeddedVideo } from "../video";
|
|
||||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||||
|
|
||||||
export const BaseUnknownEntry = t.Intersect(
|
export const BaseUnknownEntry = t.Intersect(
|
||||||
@ -28,9 +27,6 @@ export const UnknownEntry = t.Intersect([
|
|||||||
Resource(),
|
Resource(),
|
||||||
UnknownEntryTranslation,
|
UnknownEntryTranslation,
|
||||||
BaseUnknownEntry,
|
BaseUnknownEntry,
|
||||||
t.Object({
|
|
||||||
video: t.Optional(EmbeddedVideo),
|
|
||||||
}),
|
|
||||||
DbMetadata,
|
DbMetadata,
|
||||||
]);
|
]);
|
||||||
export type UnknownEntry = Prettify<typeof UnknownEntry.static>;
|
export type UnknownEntry = Prettify<typeof UnknownEntry.static>;
|
||||||
|
@ -40,6 +40,13 @@ describe("Get entries", () => {
|
|||||||
|
|
||||||
expectStatus(resp, body).toBe(200);
|
expectStatus(resp, body).toBe(200);
|
||||||
expect(body.items[0].videos).toBeArrayOfSize(1);
|
expect(body.items[0].videos).toBeArrayOfSize(1);
|
||||||
|
expect(body.items[0].videos[0]).toMatchObject({
|
||||||
|
path: madeInAbyssVideo.path,
|
||||||
|
slug: madeInAbyssVideo.slug,
|
||||||
|
version: madeInAbyssVideo.version,
|
||||||
|
rendering: madeInAbyssVideo.rendering,
|
||||||
|
part: madeInAbyssVideo.part,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user