refactor(price): improve handling of other ratios in PriceData

This commit is contained in:
CaIon
2026-07-07 21:22:19 +08:00
parent 394b023dbf
commit fc1259f583
8 changed files with 256 additions and 56 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *type
// Adaptors may have already set a more accurate count from the
// upstream response; only set the default when they haven't.
if info.PriceData.UsePrice { // only price model use N ratio
if _, hasN := info.PriceData.OtherRatios["n"]; !hasN {
if !info.PriceData.HasOtherRatio("n") {
info.PriceData.AddOtherRatio("n", float64(imageN))
}
}