From 9cfb793e599881d08078ade2899997a5c0a76c7a Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Thu, 2 Jul 2026 21:49:05 +0700 Subject: [PATCH] docs: update bulk insert video documentation --- .../schemas/bulkInsertVideo.schema.ts | 119 ++++++++++-------- .../updateAllEpisodeThumbnail.schema.ts | 35 ------ 2 files changed, 66 insertions(+), 88 deletions(-) delete mode 100644 src/modules/internal/schemas/updateAllEpisodeThumbnail.schema.ts diff --git a/src/modules/internal/schemas/bulkInsertVideo.schema.ts b/src/modules/internal/schemas/bulkInsertVideo.schema.ts index ed117ad..0ef4bd5 100644 --- a/src/modules/internal/schemas/bulkInsertVideo.schema.ts +++ b/src/modules/internal/schemas/bulkInsertVideo.schema.ts @@ -1,63 +1,76 @@ -import { t } from "elysia"; -import { AppRouteSchema } from "../../../helpers/types/AppRouteSchema"; +import {t} from "elysia"; +import {AppRouteSchema} from "../../../helpers/types/AppRouteSchema"; export const bulkInsertVideoSchema = { - body: t.Object({ - media_id: t.String({ - description: "The ID of the media for which episodes will be inserted", - }), - data: t.Array( - t.Object({ - episode: t.Number({ - description: "The episode number", + body: t.Object({ + media_id: t.String({ + description: "The ID of the media for which episodes will be inserted", }), - videos: t.Array( - t.Object({ - service_id: t.String({ - description: "The ID of the video service", + data: t.Array( + t.Object({ + episode: t.Number({ + 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", - description: - "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.", - responses: { - 201: { - description: "Videos inserted successfully", - content: { - "application/json": { - schema: { - type: "object", - properties: { - success: { type: "boolean", default: true }, - status: { type: "integer", default: 201 }, - message: { type: "string", default: "Videos inserted successfully" }, - data: { - type: "array", - default: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], - description: "An array of IDs of the inserted videos", - items: { - type: "string", - description: "The ID of the inserted video", - }, + }), + detail: { + summary: "Bulk insert videos for a media episode", + description: + "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.", + responses: { + 201: { + description: "Videos inserted successfully", + content: { + "application/json": { + schema: { + type: "object", + properties: { + success: {type: "boolean", default: true}, + status: {type: "integer", default: 201}, + message: {type: "string", default: "Videos inserted successfully"}, + data: { + type: "array", + default: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], + description: "An array of IDs of the inserted videos", + items: { + type: "string", + description: "The ID of the inserted video", + }, + }, + }, + }, + }, }, - }, }, - }, }, - }, }, - }, } satisfies AppRouteSchema; diff --git a/src/modules/internal/schemas/updateAllEpisodeThumbnail.schema.ts b/src/modules/internal/schemas/updateAllEpisodeThumbnail.schema.ts deleted file mode 100644 index 3949bc8..0000000 --- a/src/modules/internal/schemas/updateAllEpisodeThumbnail.schema.ts +++ /dev/null @@ -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;