Fix 0 value prices being saved into JSON
This commit is contained in:
parent
e9f1e77cc8
commit
eadebfb8ff
@ -47,7 +47,21 @@ namespace MarketPriceLookup
|
||||
continue;
|
||||
}
|
||||
|
||||
// Sometimes price can be 0, use other prices value
|
||||
if (priceData.Average24hPrice == 0 && priceData.Average7DaysPrice > 0)
|
||||
{
|
||||
priceData.Average24hPrice = priceData.Average7DaysPrice;
|
||||
}
|
||||
else if (priceData.Average7DaysPrice == 0 && priceData.Average24hPrice > 0)
|
||||
{
|
||||
priceData.Average7DaysPrice = priceData.Average24hPrice;
|
||||
}
|
||||
|
||||
var priceOfItem = Math.Min(priceData.Average7DaysPrice, priceData.Average24hPrice);
|
||||
if (priceOfItem <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
priceList.Add(item.Key, priceOfItem);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user