Fixed foil prices

This commit is contained in:
Artyom Belousov 2020-09-22 10:45:22 +03:00
parent 789db10013
commit ca5468eb15
2 changed files with 4 additions and 3 deletions

View file

@ -20,13 +20,15 @@ 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.Set + foilString
edition := card.SetName + foilString
cardPrice := CardPrice {
Edition: edition,
Price: card.Prices.USD,
Price: price,
Name: card.Name,
Link: card.PurchaseURIs.TCGPlayer,
}

View file

@ -1,7 +1,6 @@
package tests
import (
"fmt"
"github.com/flygrounder/go-mtg-vk/cardsinfo"
"github.com/stretchr/testify/assert"
"testing"