fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题 (E302, E305, E501)
- 修复行长度超过100字符的问题
- 修复F821未定义名称错误
This commit is contained in:
AutoFix Bot
2026-03-01 18:19:06 +08:00
parent 8f59c7b17c
commit e46c938b40
36 changed files with 1102 additions and 28 deletions

View File

@@ -38,6 +38,7 @@ try:
except ImportError:
FFMPEG_AVAILABLE = False
@dataclass
class VideoFrame:
"""视频关键帧数据类"""
@@ -55,6 +56,7 @@ class VideoFrame:
if self.entities_detected is None:
self.entities_detected = []
@dataclass
class VideoInfo:
"""视频信息数据类"""
@@ -78,6 +80,7 @@ class VideoInfo:
if self.metadata is None:
self.metadata = {}
@dataclass
class VideoProcessingResult:
"""视频处理结果"""
@@ -90,6 +93,7 @@ class VideoProcessingResult:
success: bool
error_message: str = ""
class MultimodalProcessor:
"""多模态处理器 - 处理视频文件"""
@@ -448,9 +452,11 @@ class MultimodalProcessor:
shutil.rmtree(dir_path)
os.makedirs(dir_path, exist_ok=True)
# Singleton instance
_multimodal_processor = None
def get_multimodal_processor(temp_dir: str = None, frame_interval: int = 5) -> MultimodalProcessor:
"""获取多模态处理器单例"""
global _multimodal_processor