discard unknown sets when searching original release

This commit is contained in:
kageru 2023-02-04 15:18:56 +01:00
parent 9a56895164
commit c249c872da
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

@ -44,9 +44,7 @@ impl From<&Card> for SearchCard {
original_year: card original_year: card
.card_sets .card_sets
.iter() .iter()
.filter_map(|s| { .filter_map(|s| SETS_BY_NAME.get(&s.set_name.to_lowercase()).and_then(|s| s.tcg_date))
SETS_BY_NAME.get(&s.set_name.to_lowercase()).unwrap_or_else(|| panic!("Set {} not found", s.set_name)).tcg_date
})
.map(Date::year) .map(Date::year)
.min(), .min(),
legal_copies: card.banlist_info.map(|bi| bi.ban_tcg).unwrap_or(BanlistStatus::Unlimited) as i32, legal_copies: card.banlist_info.map(|bi| bi.ban_tcg).unwrap_or(BanlistStatus::Unlimited) as i32,