Skip to content

Commit

Permalink
mtgban: Make sure to keep market shorthands unique for sealed scrapers
Browse files Browse the repository at this point in the history
  • Loading branch information
kodawah committed Oct 5, 2023
1 parent 9e37deb commit 261edee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mtgban/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mtgban

import (
"sort"
"strings"
)

// Separate a Market into multiple Seller objects
Expand All @@ -25,6 +26,10 @@ func Seller2Sellers(market Market) ([]Seller, error) {
seller.info = market.Info()
seller.info.Name = sellerName
seller.info.Shorthand = sellerName
// Shorthand must be unique and there may be stores that share the same identifier
if market.Info().SealedMode && !strings.Contains(seller.info.Shorthand, "Sealed") {
seller.info.Shorthand += " Sealed"
}
sellers = append(sellers, seller)
}
return sellers, nil
Expand Down

0 comments on commit 261edee

Please sign in to comment.