fix: 修复 voices.py 中 3 处 ruff B904 错误,解除 CI Validate-Style 阻塞 #1667
@@ -687,13 +687,13 @@ def extract_voice_from_video(
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_504_GATEWAY_TIMEOUT,
|
||||
detail="视频处理超时,请尝试较短的视频",
|
||||
)
|
||||
) from None
|
||||
except Exception as e:
|
||||
logger.exception("提取视频配音失败: %s", e)
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail="提取配音失败,请稍后重试",
|
||||
)
|
||||
) from e
|
||||
finally:
|
||||
# 清理临时文件
|
||||
if tmp_dir and Path(tmp_dir).exists():
|
||||
@@ -740,7 +740,7 @@ def _find_or_create_voice_library_for_extract(*, user_id, project_repository, as
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail="配音素材库创建失败",
|
||||
)
|
||||
) from None
|
||||
|
||||
|
||||
def _get_audio_duration(audio_path: Path) -> float:
|
||||
|
||||
Reference in New Issue
Block a user