Excluded cards with different names from results
This commit is contained in:
parent
a941095a73
commit
de1187b96c
2 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package cardsinfo
|
package cardsinfo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
scryfall "github.com/BlueMonday/go-scryfall"
|
scryfall "github.com/BlueMonday/go-scryfall"
|
||||||
|
|
@ -16,7 +17,7 @@ func GetPrices(name string) ([]CardPrice, error) {
|
||||||
opts := scryfall.SearchCardsOptions{
|
opts := scryfall.SearchCardsOptions{
|
||||||
Unique: scryfall.UniqueModePrints,
|
Unique: scryfall.UniqueModePrints,
|
||||||
}
|
}
|
||||||
resp, err := client.SearchCards(ctx, name, opts)
|
resp, err := client.SearchCards(ctx, fmt.Sprintf("!\"%v\"", name), opts)
|
||||||
var prices []CardPrice
|
var prices []CardPrice
|
||||||
for _, card := range resp.Cards {
|
for _, card := range resp.Cards {
|
||||||
edition := card.SetName + " #" + card.CollectorNumber
|
edition := card.SetName + " #" + card.CollectorNumber
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParser(t *testing.T) {
|
func TestParser(t *testing.T) {
|
||||||
prices, err := cardsinfo.GetPrices("Scavenging Ooze")
|
prices, err := cardsinfo.GetPrices("Black lotus")
|
||||||
fmt.Println(prices)
|
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