refactor(price): improve handling of other ratios in PriceData
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user