Add locate functonality

This commit is contained in:
The Magician 2024-09-12 13:31:42 +01:00
parent a18c9b2101
commit 10b3e1e46f
2 changed files with 14 additions and 3 deletions

View File

@ -34,10 +34,21 @@ func LocateCards(db *sql.DB, cardNames []string, criteria SearchCriteria) ([]str
if err != nil {
return locations, err
}
// TODO: Filter by search criteria
var location string
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]",
result.CardName,
result.SetCode,