Got all cards out from db

This commit is contained in:
2025-08-16 03:59:24 +01:00
parent ff4c58113f
commit 72fa35d41a
3 changed files with 21 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
use clap::Parser;
use scryfall_deser::get_all_card_names;
use scryfall_deser::get_local_cache_folder;
use scryfall_deser::init_db;
use scryfall_deser::update_db_with_file;
@@ -14,7 +15,11 @@ struct Args {
fn main() {
let args = Args::parse();
if args.update {
unimplemented!("Haven't implemented update yet");
init_db();
let mut path = get_local_cache_folder();
// TODO - actually download and update
path.push("oracle-cards-20250814210711.json");
update_db_with_file(path);
}
let card_name = args.remainder;
if card_name.is_empty() {
@@ -22,9 +27,6 @@ fn main() {
}
let search_string = card_name.join(" ");
dbg!(search_string);
init_db();
let mut path = get_local_cache_folder();
path.push("oracle-cards-20250814210711.json");
update_db_with_file(path);
let cards = get_all_card_names();
dbg!(cards);
}