Add locate functonality
This commit is contained in:
parent
a18c9b2101
commit
10b3e1e46f
|
@ -34,10 +34,21 @@ func LocateCards(db *sql.DB, cardNames []string, criteria SearchCriteria) ([]str
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return locations, err
|
return locations, err
|
||||||
}
|
}
|
||||||
// TODO: Filter by search criteria
|
|
||||||
|
|
||||||
var location string
|
var location string
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
|
printing := database.CardPrinting{
|
||||||
|
SetCode: result.SetCode,
|
||||||
|
IsFoil: result.IsFoil,
|
||||||
|
IsPromo: result.IsPromo,
|
||||||
|
Language: result.Language,
|
||||||
|
}
|
||||||
|
|
||||||
|
filter := filterPrinting(printing, criteria)
|
||||||
|
if filter {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
location = fmt.Sprintf("%s (%s %s) [%s]",
|
location = fmt.Sprintf("%s (%s %s) [%s]",
|
||||||
result.CardName,
|
result.CardName,
|
||||||
result.SetCode,
|
result.SetCode,
|
||||||
|
|
Loading…
Reference in New Issue