Separated foils from regulars

This commit is contained in:
Artyom Belousov 2020-09-22 11:00:17 +03:00
parent ca5468eb15
commit 495842efc0
4 changed files with 16 additions and 9 deletions

View file

@ -20,15 +20,14 @@ func GetPrices(name string) ([]CardPrice, error) {
var prices []CardPrice
for _, card := range resp.Cards {
foilString := ""
price := card.Prices.USD
if card.Foil {
foilString = "(Foil)"
price = card.Prices.USDFoil
}
edition := card.SetName + foilString
if card.Prices.USD == "" && card.Prices.USDFoil == "" {
continue
}
cardPrice := CardPrice {
Edition: edition,
Price: price,
Price: card.Prices.USD,
PriceFoil: card.Prices.USDFoil,
Name: card.Name,
Link: card.PurchaseURIs.TCGPlayer,
}