Changed API to ScryFall

This commit is contained in:
Artyom Belousov 2019-05-12 12:57:48 +03:00
parent 002c175af1
commit 4ca07883a9
2 changed files with 38 additions and 42 deletions

View file

@ -1,8 +1,24 @@
package cardsinfo
import (
"strings"
)
type CardPrice struct {
Name string
Price float64
Link string
Edition string
}
type Card struct {
Name string `json:"name"`
Layout string `json:"layout"`
}
func (c *Card) getName() string {
if c.Layout == "transform" {
return strings.Replace(c.Name, "//", "|", 1)
}
return c.Name
}