- Introduced "video" as a new content type across backend and frontend. - Updated validation schemas and MIME-type handling for video files. - Implemented file size limits for videos (10 MB max) in configuration. - Enhanced upload flow with auto-detection of file types (image, GIF, video). - Expanded media processing to handle video files and convert them to WebM format.
31 lines
472 B
TypeScript
31 lines
472 B
TypeScript
import {
|
|
IsArray,
|
|
IsEnum,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
MaxLength,
|
|
} from "class-validator";
|
|
import { ContentType } from "./create-content.dto";
|
|
|
|
export class UploadContentDto {
|
|
@IsEnum(ContentType)
|
|
type!: "meme" | "gif" | "video";
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(255)
|
|
title!: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
categoryId?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
@MaxLength(64, { each: true })
|
|
tags?: string[];
|
|
}
|