Move filter function

This commit is contained in:
The Magician 2024-09-12 13:35:20 +01:00
parent 34da4ae77b
commit 52d9e9184f
1 changed files with 0 additions and 26 deletions

View File

@ -29,32 +29,6 @@ type SearchCriteria struct {
// fzf) to `string` values (which represent a primary key in the CardPrintings table)
type InsertSearchOptions map[string]string
func filterPrinting(printing database.CardPrinting, searchCriteria SearchCriteria) bool {
if searchCriteria.SetCode != "" && printing.SetCode != searchCriteria.SetCode {
return true
}
if searchCriteria.Foil == False && printing.IsFoil {
return true
}
if searchCriteria.Foil == True && !printing.IsFoil {
return true
}
if searchCriteria.Promo == False && printing.IsPromo {
return true
}
if searchCriteria.Promo == True && !printing.IsPromo {
return true
}
if searchCriteria.Language != "" && printing.Language != searchCriteria.Language {
return true
}
return false
}
func GetAllSearchOptions(db *sql.DB, searchCriteria SearchCriteria) (InsertSearchOptions, error) {
var searchOptions InsertSearchOptions = make(map[string]string)