fix: 修复视频任务不同分组可能导致补回额度计算错误 - #2030
Conversation
WalkthroughThe Task model gained a Group field populated from relayInfo.UsingGroup. The video task update logic now determines the group from task.Group or, if absent, fetches the user to derive it. User lookup and group ratio calculations occur only when a non-empty group is available; billing paths use the resolved group. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant VC as VideoController
participant U as UserService
participant B as Billing/Throttle
C->>VC: updateVideoSingleTask(task)
alt task.Group present
VC->>VC: use task.Group
else task.Group empty
VC->>U: fetch user
U-->>VC: user(group)
VC->>VC: derive group from user
end
alt group is non-empty
VC->>B: compute model/group ratio
B-->>VC: finalGroupRatio
VC->>B: perform billing calc
B-->>VC: billing result
else group is empty
VC->>VC: skip ratio/billing by group
end
VC-->>C: return updated task/result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)controller/task_video.go (2)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* main: (42 commits) fix: remove redundant error handling for empty Gemini API response fix(convert): 修复 OpenAI 转 Claude 流时 thinking 块的格式问题 fix: improve error handling for email sending failures feat: add support for Sora channel type and OpenAI video endpoint feat: jimeng images base64 limit (#2032) fix: 修复视频任务不同分组可能导致补回额度计算错误 (#2030) feat: jimeng use openai sdk input_reference i2v refactor: Openai video model 移动到 dto fix: update error messages for unsupported parameter names in Google extra body fix: 修复工作流重复创建release的问题 feat: Add pre-status protection for IncreaseUserQuota fix: empty version feat: support free model setting fix: version ignore ghcr fix: mask sensitive information in error messages and refine task retrieval query feat: add vidu use openai sdk fix: kling create video via openai sdk refactor: add openaiVideo and method feat: add jimeng use openai sdk ... # Conflicts: # Dockerfile # model/log.go # relay/channel/openai/relay-openai.go # relay/compatible_handler.go
…ulk-edit-scope-and-compact feat: support filtered account bulk edit and align compact OpenAI bulk fields
Summary by CodeRabbit
New Features
Performance