import { IsNotEmpty, IsOptional, IsString, IsInt, Min } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreateEpisodeDto {
  @ApiProperty({ example: 1 })
  @IsInt()
  @IsNotEmpty()
  @Min(1)
  number: number;

  @ApiProperty({ example: 'Pilot' })
  @IsString()
  @IsNotEmpty()
  title: string;

  @ApiProperty({ example: 'https://stream.example.com/series/s01e01.m3u8' })
  @IsString()
  @IsNotEmpty()
  streamUrl: string;

  @ApiPropertyOptional({ example: 58 })
  @IsOptional()
  @IsInt()
  @Min(1)
  durationMin?: number;

  @ApiPropertyOptional({ example: 'https://example.com/thumb.jpg' })
  @IsOptional()
  @IsString()
  thumbnailUrl?: string;
}
