Excluded cards with different names from results

This commit is contained in:
Artyom Belousov 2020-09-22 12:11:49 +03:00
parent a941095a73
commit de1187b96c
2 changed files with 3 additions and 2 deletions

View file

@ -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