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
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"context"
|
||||
|
||||
scryfall "github.com/BlueMonday/go-scryfall"
|
||||
|
|
@ -16,7 +17,7 @@ func GetPrices(name string) ([]CardPrice, error) {
|
|||
opts := scryfall.SearchCardsOptions{
|
||||
Unique: scryfall.UniqueModePrints,
|
||||
}
|
||||
resp, err := client.SearchCards(ctx, name, opts)
|
||||
resp, err := client.SearchCards(ctx, fmt.Sprintf("!\"%v\"", name), opts)
|
||||
var prices []CardPrice
|
||||
for _, card := range resp.Cards {
|
||||
edition := card.SetName + " #" + card.CollectorNumber
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func TestParser(t *testing.T) {
|
||||
prices, err := cardsinfo.GetPrices("Scavenging Ooze")
|
||||
prices, err := cardsinfo.GetPrices("Black lotus")
|
||||
fmt.Println(prices)
|
||||
assert.Nil(t, err)
|
||||
assert.NotEmpty(t, prices)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue