docs: update bulk insert video documentation

This commit is contained in:
2026-07-02 21:49:05 +07:00
parent 51693959b6
commit 9cfb793e59
2 changed files with 66 additions and 88 deletions

View File

@ -1,63 +1,76 @@
import { t } from "elysia"; import {t} from "elysia";
import { AppRouteSchema } from "../../../helpers/types/AppRouteSchema"; import {AppRouteSchema} from "../../../helpers/types/AppRouteSchema";
export const bulkInsertVideoSchema = { export const bulkInsertVideoSchema = {
body: t.Object({ body: t.Object({
media_id: t.String({ media_id: t.String({
description: "The ID of the media for which episodes will be inserted", description: "The ID of the media for which episodes will be inserted",
}),
data: t.Array(
t.Object({
episode: t.Number({
description: "The episode number",
}), }),
videos: t.Array( data: t.Array(
t.Object({ t.Object({
service_id: t.String({ episode: t.Number({
description: "The ID of the video service", description: "The episode number",
}),
videos: t.Array(
t.Object({
service_id: t.String({
description: "The ID of the video service",
}),
priority: t.Optional(t.Number({
description: "The priority of the video (can't be duplicate)",
})),
video_code: t.String({
description: "The code of the video on the service",
}),
short_code: t.Optional(
t.String({
description: "The code of the preview video on the service",
}),
),
thumbnail_code: t.Optional(
t.String({
description: "The code of the thumbnail for the video on the service",
}),
),
download_code: t.Optional(
t.String({
description: "The code of the download link for the video on the service",
})
)
}),
),
}), }),
video_code: t.String({
description: "The code of the video on the service",
}),
thumbnail_code: t.Optional(
t.String({
description: "The code of the thumbnail for the video on the service",
}),
),
}),
), ),
}), }),
), detail: {
}), summary: "Bulk insert videos for a media episode",
detail: { description:
summary: "Bulk insert videos for a media episode", "Perform bulk insert of videos for specific episodes of a media. This operation inserts multiple videos associated with different episodes into the database based on the provided data.",
description: responses: {
"Perform bulk insert of videos for specific episodes of a media. This operation inserts multiple videos associated with different episodes into the database based on the provided data.", 201: {
responses: { description: "Videos inserted successfully",
201: { content: {
description: "Videos inserted successfully", "application/json": {
content: { schema: {
"application/json": { type: "object",
schema: { properties: {
type: "object", success: {type: "boolean", default: true},
properties: { status: {type: "integer", default: 201},
success: { type: "boolean", default: true }, message: {type: "string", default: "Videos inserted successfully"},
status: { type: "integer", default: 201 }, data: {
message: { type: "string", default: "Videos inserted successfully" }, type: "array",
data: { default: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
type: "array", description: "An array of IDs of the inserted videos",
default: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], items: {
description: "An array of IDs of the inserted videos", type: "string",
items: { description: "The ID of the inserted video",
type: "string", },
description: "The ID of the inserted video", },
}, },
},
},
}, },
},
}, },
},
}, },
},
}, },
},
} satisfies AppRouteSchema; } satisfies AppRouteSchema;

View File

@ -1,35 +0,0 @@
import { t } from "elysia";
import { AppRouteSchema } from "../../../helpers/types/AppRouteSchema";
export const updateAllEpisodeThumbnailSchema = {
body: t.Object({
service_reference_id: t.String({
description: "The ID of the service to which the target of episode thumbnails belong",
}),
}),
detail: {
summary: "Bulk update episode thumbnails",
description:
"Perform bulk update of episode thumbnails for all episodes associated with a specific service reference ID. This operation fetches the latest thumbnail data from external sources and updates the existing episode records in the database accordingly.",
responses: {
204: {
description: "Updating episode thumbnails operation completed successfully",
content: {
"application/json": {
schema: {
type: "object",
properties: {
success: { type: "boolean", default: true },
status: { type: "integer", default: 204 },
message: {
type: "string",
default: "Updating {newEpisodeThumbnailsCount} episode thumbnails operation completed successfully",
},
},
},
},
},
},
},
},
} satisfies AppRouteSchema;