1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-23 01:54: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!("Using {} locale!", &locale);
debug!("Detecting set codes to fetch..."); debug!("Detecting set codes to fetch...");
let known_set_codes: Vec<String> = env::var("DATA_DRAGON_SET_CODES") let known_set_codes: String = env::var("DATA_DRAGON_SET_CODES")
.expect("DATA_DRAGON_SET_CODES to be set") .expect("DATA_DRAGON_SET_CODES to be set");
.split(",") let known_set_codes: Vec<&str> = known_set_codes
.into(); .rsplit(",")
debug!("Using set codes: {:#?}", &known_set_codes); .collect();
debug!("Detected set codes: {:?}", &known_set_codes);
debug!("Creating LocalizedGlobalIndexes..."); debug!("Creating LocalizedGlobalIndexes...");
let globals = create_globalindexes_from_dd_latest(&locale).await; let globals = create_globalindexes_from_dd_latest(&locale).await;
debug!("Created LocalizedGlobalIndexes!"); debug!("Created LocalizedGlobalIndexes!");
debug!("Creating CardIndex..."); 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!("Created CardIndex!");
debug!("Creating CardSearchEngine..."); debug!("Creating CardSearchEngine...");

View file

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