fix(video): 视频任务 - 规范化数字清晰度价格档

This commit is contained in:
ddcat666 committed 2026-09-27 20:09:41 +08:00
1 parent 414d367416
commit a0ba303b02
3 files changed
+51

No files matched your search

+7
View File
@@ -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
}
}