Skip to content

Commit

Permalink
mtgban/arbit: Support filtering editions by their set code too
Browse files Browse the repository at this point in the history
  • Loading branch information
kodawah committed Apr 30, 2024
1 parent 993941b commit 0e6cfc6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mtgban/arbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ type ArbitOpts struct {
// List of rarities to ignore
Rarities []string

// List of editions to ignore
// List of editions (or set codes) to ignore
Editions []string

// List of editions to select
// List of editions (or set codes) to select
OnlyEditions []string

// List of per-edition collector numbers to select
Expand Down Expand Up @@ -222,10 +222,10 @@ func Arbit(opts *ArbitOpts, vendor Vendor, seller Seller) (result []ArbitEntry,
if filterDecksOnly && co.Sealed && !mtgmatcher.SealedHasDecklist(co.SetCode, cardId) {
continue
}
if slices.Contains(filterEditions, co.Edition) {
if slices.Contains(filterEditions, co.Edition) || slices.Contains(filterEditions, co.SetCode) {
continue
}
if filterSelectedEditions != nil && !slices.Contains(filterSelectedEditions, co.Edition) {
if filterSelectedEditions != nil && !slices.Contains(filterSelectedEditions, co.Edition) && !slices.Contains(filterSelectedEditions, co.SetCode) {
continue
}
cnRange, found := filterSelectedCNRange[co.Edition]
Expand Down Expand Up @@ -503,10 +503,10 @@ func Mismatch(opts *ArbitOpts, reference Seller, probe Seller) (result []ArbitEn
if filterRLOnly && !co.IsReserved {
continue
}
if slices.Contains(filterEditions, co.Edition) {
if slices.Contains(filterEditions, co.Edition) || slices.Contains(filterEditions, co.SetCode) {
continue
}
if filterSelectedEditions != nil && !slices.Contains(filterSelectedEditions, co.Edition) {
if filterSelectedEditions != nil && !slices.Contains(filterSelectedEditions, co.Edition) && !slices.Contains(filterSelectedEditions, co.SetCode) {
continue
}
cnRange, found := filterSelectedCNRange[co.Edition]
Expand Down

0 comments on commit 0e6cfc6

Please sign in to comment.