1
This commit is contained in:
@@ -10,6 +10,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from app.config import settings
|
||||
from app.dependencies import get_current_user, get_db
|
||||
from app.models.user import User
|
||||
from app.enums.common import ModuleEventTypeEnum
|
||||
from app.enums.generation_task import GenerationOwnerType
|
||||
from app.enums.shot_replicate import (
|
||||
ModuleCodeEnum,
|
||||
@@ -862,24 +863,17 @@ async def create_replication_project_from_segment(
|
||||
current_user: User = Depends(get_current_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
try:
|
||||
segment = await get_segment_for_user(db, segment_id=segment_id, user=current_user, for_update=True)
|
||||
project = await create_shot_replicate_project_from_segment(db, current_user=current_user, segment=segment, req=req)
|
||||
project_id = project.id
|
||||
await db.commit()
|
||||
except HTTPException:
|
||||
await db.rollback()
|
||||
raise
|
||||
except Exception as exc:
|
||||
await db.rollback()
|
||||
_log_api_exception_from_locals(exc, locals(), f"创建拆镜复刻项目失败: {exc}")
|
||||
raise HTTPException(status_code=500, detail=f"创建拆镜复刻项目失败: {exc}")
|
||||
|
||||
return ShotReplicateActionOut(
|
||||
message="已从拆镜片段创建复刻项目,素材视频已锁定",
|
||||
project_id=project_id,
|
||||
step_id=None,
|
||||
detail=await _reload_project_detail(db, current_user, project_id),
|
||||
log_module_event_file(
|
||||
module=MODULE,
|
||||
event_type=ModuleEventTypeEnum.V1_CREATE_BLOCKED.value,
|
||||
user_id=current_user.id,
|
||||
step_id=segment_id,
|
||||
message="拦截拆镜复刻 V1 创建请求",
|
||||
detail={"api_version": "v1", "flow_version": "v1", "segment_id": segment_id},
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=410,
|
||||
detail="V1 创建流程已停止,请使用 V2 API",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user