大量优化修改扣积分规则

This commit is contained in:
Azmat@qq.com
2026-09-04 17:20:22 +08:00
parent 3e904479d9
commit 15718a60bf
41 changed files with 1590 additions and 429 deletions
@@ -106,6 +106,15 @@ def adopt_script_version(project: Project, script: ScriptVersion) -> None:
if not script.is_adopted:
script.is_adopted = True
script.save(update_fields=["is_adopted", "updated_at"])
# 定稿即本地拆角色/场景(不调模型、不扣费),资产页无需再付费「提取」
try:
from apps.ai.entity_local import materialize_script_entities
materialize_script_entities(project=project, script=script)
except Exception: # noqa: BLE001 — 拆实体失败不挡定稿进资产;用户仍可点「提取」重试
import logging
logging.getLogger(__name__).exception("local entity materialize on adopt failed for project %s", project.id)
sync_video_segments_to_script(project, script)
stage, _ = ProjectStage.objects.get_or_create(project=project, stage=ProjectStage.Stage.SCRIPT)
stage.status = ProjectStage.Status.SUCCEEDED