From ca5468eb15517588357dcdcda252a84746b03572 Mon Sep 17 00:00:00 2001 From: Artyom Belousov Date: Tue, 22 Sep 2020 10:45:22 +0300 Subject: [PATCH] Fixed foil prices --- cardsinfo/prices.go | 6 ++++-- tests/prices_test.go | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cardsinfo/prices.go b/cardsinfo/prices.go index 398fed9..1f7984c 100644 --- a/cardsinfo/prices.go +++ b/cardsinfo/prices.go @@ -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, } diff --git a/tests/prices_test.go b/tests/prices_test.go index d13a51c..f06d1ea 100644 --- a/tests/prices_test.go +++ b/tests/prices_test.go @@ -1,7 +1,6 @@ package tests import ( - "fmt" "github.com/flygrounder/go-mtg-vk/cardsinfo" "github.com/stretchr/testify/assert" "testing"