This commit is contained in:
2026-06-05 09:23:00 +08:00
parent fd9a259917
commit e97b09470a
2 changed files with 6 additions and 16 deletions
+4 -14
View File
@@ -398,7 +398,7 @@ async def generate(
duration=duration, duration=duration,
resolution=req.resolution, resolution=req.resolution,
project_name=project_name, project_name=project_name,
description_prefix="视频生成", description_prefix=project_name+"-",
owner_type=OWNER_GENERATION_RECORD, owner_type=OWNER_GENERATION_RECORD,
attempt_no=attempt_no, attempt_no=attempt_no,
) )
@@ -420,12 +420,7 @@ async def generate(
from app.services.video_queue import task_queue from app.services.video_queue import task_queue
engine = await get_active_engine(db) engine = await get_active_engine(db)
task_id = await submit_video_task( task_id = await submit_video_task(db, engine, record)
db,
engine,
record,
include_media_references=False,
)
record.seedance_task_id = task_id record.seedance_task_id = task_id
await db.flush() await db.flush()
await task_queue.enqueue(record_id) await task_queue.enqueue(record_id)
@@ -446,7 +441,7 @@ async def generate(
gen_type="image", gen_type="image",
image_size=image_size, image_size=image_size,
project_name=project_name, project_name=project_name,
description_prefix="图片生成", description_prefix=project_name+"-",
owner_type=OWNER_GENERATION_RECORD, owner_type=OWNER_GENERATION_RECORD,
attempt_no=attempt_no, attempt_no=attempt_no,
) )
@@ -528,12 +523,7 @@ async def retry_generation(
if record.gen_type == GenerationType.video: if record.gen_type == GenerationType.video:
from app.services.video_gen import get_active_engine, submit_video_task, extract_error_message from app.services.video_gen import get_active_engine, submit_video_task, extract_error_message
engine = await get_active_engine(db) engine = await get_active_engine(db)
task_id = await submit_video_task( task_id = await submit_video_task(db, engine, record)
db,
engine,
record,
include_media_references=False,
)
record.seedance_task_id = task_id record.seedance_task_id = task_id
await db.flush() await db.flush()
await task_queue.enqueue(record_id) await task_queue.enqueue(record_id)
@@ -298,7 +298,7 @@ async def charge_generation_media_by_params(
resolution: str | None = None, resolution: str | None = None,
engine_id: str | None = None, engine_id: str | None = None,
project_name: str | None = None, project_name: str | None = None,
description_prefix: str = "ChatAPI异步", description_prefix: str = "AI创作-",
owner_type: str = OWNER_CHAT_GENERATION_TASK, owner_type: str = OWNER_CHAT_GENERATION_TASK,
attempt_no: int | None = None, attempt_no: int | None = None,
) -> BillingSummary: ) -> BillingSummary:
@@ -364,7 +364,7 @@ async def charge_generation_media_for_record(
*, *,
record: GenerationRecord, record: GenerationRecord,
project_name: str | None = None, project_name: str | None = None,
description_prefix: str = "ChatAPI异步", description_prefix: str = "AI创作-",
attempt_no: int | None = None, attempt_no: int | None = None,
) -> BillingSummary: ) -> BillingSummary:
return await charge_generation_media_by_params( return await charge_generation_media_by_params(