fix(pricing): 修复单独设置1K/2K/4K分辨率价格时因意图丢失quality导致价格无法匹配的Bug
This commit is contained in:
1 parent
4eeef3cfd8
commit
b08ac2a01c
3 files changed
+89
-2
No files matched your search
@@ -524,7 +524,20 @@ func validateCreationSubmissionScope(run *model.CreationRun, version int64, req
|
||||
if key == "videoSeconds" {
|
||||
metadataKey = "seconds"
|
||||
}
|
||||
if approved := stringValue(meta[metadataKey]); approved != "" && approved != stringValue(config[key]) {
|
||||
approved := strings.TrimSpace(stringValue(meta[metadataKey]))
|
||||
candidate := strings.TrimSpace(stringValue(config[key]))
|
||||
if metadataKey == "quality" {
|
||||
approvedNorm := strings.ToLower(approved)
|
||||
candidateNorm := strings.ToLower(candidate)
|
||||
// auto/any 与空缺在图片生成中等价,前端 omittedImageQuality 可能会省略默认 quality
|
||||
if (approvedNorm == "auto" || approvedNorm == "any" || approvedNorm == "") && (candidateNorm == "auto" || candidateNorm == "any" || candidateNorm == "") {
|
||||
continue
|
||||
}
|
||||
if approvedNorm == candidateNorm {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if approved != "" && approved != candidate {
|
||||
return creationConflict("生成规格与已批准方案不同")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user