fix(video): 视频任务 - 规范化数字清晰度价格档
This commit is contained in:
1 parent
414d367416
commit
a0ba303b02
3 files changed
+51
No files matched your search
@@ -133,6 +133,13 @@ func normalizeModelRequestOption(name string, value any) any {
|
||||
case "4k", "2160", "2160p":
|
||||
return "2160p"
|
||||
default:
|
||||
// Providers expose additional resolutions such as 768P and 960P.
|
||||
// Canonicalize numeric P values generically so billing selectors match
|
||||
// regardless of whether the client sends "960" or "960P".
|
||||
pixels := strings.TrimSuffix(strings.ToLower(strings.TrimSpace(resolution)), "p")
|
||||
if numeric, err := strconv.Atoi(pixels); err == nil && numeric > 0 {
|
||||
return strconv.Itoa(numeric) + "p"
|
||||
}
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user