Added collectors number to edition
This commit is contained in:
parent
194aee8e69
commit
a941095a73
2 changed files with 3 additions and 5 deletions
|
|
@ -19,11 +19,7 @@ func GetPrices(name string) ([]CardPrice, error) {
|
||||||
resp, err := client.SearchCards(ctx, name, opts)
|
resp, err := client.SearchCards(ctx, name, opts)
|
||||||
var prices []CardPrice
|
var prices []CardPrice
|
||||||
for _, card := range resp.Cards {
|
for _, card := range resp.Cards {
|
||||||
fullArtString := ""
|
edition := card.SetName + " #" + card.CollectorNumber
|
||||||
if card.FullArt {
|
|
||||||
fullArtString = " (Fullart)"
|
|
||||||
}
|
|
||||||
edition := card.SetName + fullArtString
|
|
||||||
if card.Prices.USD == "" && card.Prices.USDFoil == "" {
|
if card.Prices.USD == "" && card.Prices.USDFoil == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/flygrounder/go-mtg-vk/cardsinfo"
|
"github.com/flygrounder/go-mtg-vk/cardsinfo"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -8,6 +9,7 @@ import (
|
||||||
|
|
||||||
func TestParser(t *testing.T) {
|
func TestParser(t *testing.T) {
|
||||||
prices, err := cardsinfo.GetPrices("Scavenging Ooze")
|
prices, err := cardsinfo.GetPrices("Scavenging Ooze")
|
||||||
|
fmt.Println(prices)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.NotEmpty(t, prices)
|
assert.NotEmpty(t, prices)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue