1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-22 17:44:22 +00:00

Add proper support to custom set codes

This commit is contained in:
Steffo 2023-03-24 13:22:33 +01:00
parent 34c396b5de
commit e6fc162578
Signed by: steffo
GPG key ID: 2A24051445686895
2 changed files with 14 additions and 12 deletions

View file

@ -19,18 +19,19 @@ pub async fn main() {
debug!("Using {} locale!", &locale);
debug!("Detecting set codes to fetch...");
let known_set_codes: Vec<String> = env::var("DATA_DRAGON_SET_CODES")
.expect("DATA_DRAGON_SET_CODES to be set")
.split(",")
.into();
debug!("Using set codes: {:#?}", &known_set_codes);
let known_set_codes: String = env::var("DATA_DRAGON_SET_CODES")
.expect("DATA_DRAGON_SET_CODES to be set");
let known_set_codes: Vec<&str> = known_set_codes
.rsplit(",")
.collect();
debug!("Detected set codes: {:?}", &known_set_codes);
debug!("Creating LocalizedGlobalIndexes...");
let globals = create_globalindexes_from_dd_latest(&locale).await;
debug!("Created LocalizedGlobalIndexes!");
debug!("Creating CardIndex...");
let cards = create_cardindex_from_dd_latest(&locale, &known_set_codes).await;
let cards = create_cardindex_from_dd_latest(&locale, known_set_codes.into_iter()).await;
debug!("Created CardIndex!");
debug!("Creating CardSearchEngine...");

View file

@ -20,18 +20,19 @@ pub async fn main() {
debug!("Using {} locale!", &locale);
debug!("Detecting set codes to fetch...");
let known_set_codes: Vec<String> = env::var("DATA_DRAGON_SET_CODES")
.expect("DATA_DRAGON_SET_CODES to be set")
.split(",")
.into();
debug!("Using set codes: {:#?}", &known_set_codes);
let known_set_codes: String = env::var("DATA_DRAGON_SET_CODES")
.expect("DATA_DRAGON_SET_CODES to be set");
let known_set_codes: Vec<&str> = known_set_codes
.rsplit(",")
.collect();
debug!("Detected set codes: {:?}", &known_set_codes);
debug!("Creating LocalizedGlobalIndexes...");
let globals = create_globalindexes_from_dd_latest(&locale).await;
debug!("Created LocalizedGlobalIndexes!");
debug!("Creating CardIndex...");
let cards = create_cardindex_from_dd_latest(&locale, &known_set_codes).await;
let cards = create_cardindex_from_dd_latest(&locale, known_set_codes.into_iter()).await;
debug!("Created CardIndex!");
debug!("Creating CardSearchEngine...");