#!/usr/bin/env python3
"""
媒体管理相关的数据类型定义
"""

from dataclasses import dataclass
from typing import List, Optional

@dataclass
class VideoSegment:
    """视频片段数据结构"""
    id: str
    original_video_id: str
    segment_index: int
    filename: str
    file_path: str
    md5_hash: str
    file_size: int
    duration: float
    width: int
    height: int
    fps: float
    format: str
    start_time: float
    end_time: float
    tags: List[str]
    use_count: int
    thumbnail_path: Optional[str] = None
    scene_score: Optional[float] = None
    motion_score: Optional[float] = None
    brightness: Optional[float] = None
    contrast: Optional[float] = None
    created_at: str = ""
    updated_at: str = ""
    is_active: bool = True

@dataclass
class OriginalVideo:
    """原始视频数据结构"""
    id: str
    filename: str
    file_path: str
    md5_hash: str
    file_size: int
    duration: float
    width: int
    height: int
    fps: float
    format: str
    segment_count: int
    tags: List[str]
    created_at: str = ""
    updated_at: str = ""
    is_active: bool = True

@dataclass
class VideoInfo:
    """视频信息"""
    duration: float
    width: int
    height: int
    fps: float
    frame_count: int
    file_size: int
    codec: str

@dataclass
class UploadResult:
    """上传结果"""
    original_video: dict
    segments: List[dict]
    is_duplicate: bool
    segments_regenerated: bool = False

@dataclass
class BatchUploadResult:
    """批量上传结果"""
    total_files: int
    uploaded_files: int
    skipped_files: int
    failed_files: int
    total_segments: int
    uploaded_list: List[dict]
    skipped_list: List[dict]
    failed_list: List[dict]
