From 9f153eec5439c6ce0347dff71af70648cbce7f5b Mon Sep 17 00:00:00 2001 From: CI Bot Date: Sun, 26 Jul 2026 16:28:12 +0000 Subject: [PATCH] style: auto-format with black + isort + prettier --- apps/worker/video_processing/concat_engine.py | 5 +++-- .../subtitle_render_engine.py | 19 ++++++++++--------- .../unified_render_service.py | 16 +++++++--------- tests/unit/test_subtitle_style.py | 2 +- tests/unit/test_tts_streaming_service.py | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/worker/video_processing/concat_engine.py b/apps/worker/video_processing/concat_engine.py index 166ccfe33..3bf049412 100755 --- a/apps/worker/video_processing/concat_engine.py +++ b/apps/worker/video_processing/concat_engine.py @@ -20,6 +20,9 @@ from __future__ import annotations import logging from pathlib import Path +from video_processing.ffmpeg_utils import FFMPEG_BIN, probe_duration, probe_video_info, run_ffmpeg +from video_processing.path_security import PathSecurityError, is_in_allowed_dirs, safe_resolve_path + from packages.domain.video_concat import ( # noqa: F401 向后兼容导出 ALLOWED_VIDEO_EXTENSIONS, CONCAT_DEMUXER_REQUIRED_PARAMS, @@ -27,8 +30,6 @@ from packages.domain.video_concat import ( # noqa: F401 向后兼容导出 ConcatConfig, ConcatSegment, ) -from video_processing.ffmpeg_utils import FFMPEG_BIN, probe_duration, probe_video_info, run_ffmpeg -from video_processing.path_security import PathSecurityError, is_in_allowed_dirs, safe_resolve_path logger = logging.getLogger(__name__) diff --git a/apps/worker/video_processing/subtitle_render_engine.py b/apps/worker/video_processing/subtitle_render_engine.py index d15994991..a227205aa 100755 --- a/apps/worker/video_processing/subtitle_render_engine.py +++ b/apps/worker/video_processing/subtitle_render_engine.py @@ -26,7 +26,9 @@ from __future__ import annotations import logging from pathlib import Path -from packages.domain.subtitle_style import ( # noqa: F401 向后兼容导出 +from video_processing.path_security import PathSecurityError, is_in_allowed_dirs, safe_resolve_path + +from packages.domain.subtitle_style import ( ALLOWED_SUBTITLE_EXTENSIONS, DEFAULT_COLOR, DEFAULT_FONT, @@ -35,18 +37,17 @@ from packages.domain.subtitle_style import ( # noqa: F401 向后兼容导出 DEFAULT_POSITION, DEFAULT_STROKE_COLOR, DEFAULT_STROKE_WIDTH, - POSITION_ALIGNMENT, POSITION_ALIASES, + POSITION_ALIGNMENT, SubtitleSegment, SubtitleStyle, - escape_ass_text as _escape_ass_text, - format_ass_time as _format_ass_time, - hex_to_ass_bgr as _hex_to_ass_bgr, - hex_to_ass_color as _hex_to_ass_color, - opacity_to_ass_alpha as _opacity_to_ass_alpha, - wrap_text as _wrap_text, ) -from video_processing.path_security import PathSecurityError, is_in_allowed_dirs, safe_resolve_path +from packages.domain.subtitle_style import escape_ass_text as _escape_ass_text # noqa: F401 向后兼容导出 +from packages.domain.subtitle_style import format_ass_time as _format_ass_time +from packages.domain.subtitle_style import hex_to_ass_bgr as _hex_to_ass_bgr +from packages.domain.subtitle_style import hex_to_ass_color as _hex_to_ass_color +from packages.domain.subtitle_style import opacity_to_ass_alpha as _opacity_to_ass_alpha +from packages.domain.subtitle_style import wrap_text as _wrap_text logger = logging.getLogger(__name__) diff --git a/apps/worker/video_processing/unified_render_service.py b/apps/worker/video_processing/unified_render_service.py index 3a13199fa..3a35dda9a 100755 --- a/apps/worker/video_processing/unified_render_service.py +++ b/apps/worker/video_processing/unified_render_service.py @@ -52,15 +52,13 @@ from video_processing.trim_engine import TrimConfig, TrimEngine, extract_trim_fr from video_processing.tts_engine import TtsEngine from video_processing.watermark_engine import WatermarkConfig, WatermarkEngine -from packages.domain.render_layer_utils import ( - LAYER_Z_INDEX as _IMPORTED_LAYER_Z_INDEX, - can_pass_through as _can_pass_through_pure, - clip_adjusted_duration as _clip_adjusted_duration_pure, - clip_effective_duration as _clip_effective_duration_pure, - clip_playback_speed as _clip_playback_speed_pure, - estimate_total_duration as _estimate_total_duration_pure, - resolve_layer_role as _resolve_layer_role_pure, -) +from packages.domain.render_layer_utils import LAYER_Z_INDEX as _IMPORTED_LAYER_Z_INDEX +from packages.domain.render_layer_utils import can_pass_through as _can_pass_through_pure +from packages.domain.render_layer_utils import clip_adjusted_duration as _clip_adjusted_duration_pure +from packages.domain.render_layer_utils import clip_effective_duration as _clip_effective_duration_pure +from packages.domain.render_layer_utils import clip_playback_speed as _clip_playback_speed_pure +from packages.domain.render_layer_utils import estimate_total_duration as _estimate_total_duration_pure +from packages.domain.render_layer_utils import resolve_layer_role as _resolve_layer_role_pure from packages.domain.tts_config import TtsConfig logger = logging.getLogger(__name__) diff --git a/tests/unit/test_subtitle_style.py b/tests/unit/test_subtitle_style.py index 94a0808e0..ddf397671 100755 --- a/tests/unit/test_subtitle_style.py +++ b/tests/unit/test_subtitle_style.py @@ -13,8 +13,8 @@ from packages.domain.subtitle_style import ( DEFAULT_POSITION, DEFAULT_STROKE_COLOR, DEFAULT_STROKE_WIDTH, - POSITION_ALIGNMENT, POSITION_ALIASES, + POSITION_ALIGNMENT, SubtitleSegment, SubtitleStyle, escape_ass_text, diff --git a/tests/unit/test_tts_streaming_service.py b/tests/unit/test_tts_streaming_service.py index 9d3d36eab..ae7e14b06 100755 --- a/tests/unit/test_tts_streaming_service.py +++ b/tests/unit/test_tts_streaming_service.py @@ -15,9 +15,9 @@ import pytest from packages.application.cosyvoice_service import CosyVoiceError from packages.application.tts_job.streaming_service import ( + _AUDIO_CHUNK_SIZE, TTSStreamingError, TTSStreamingService, - _AUDIO_CHUNK_SIZE, ) # ── Fixtures ──────────────────────────────────────────────────────────────