Initial commit: MTG personal library catalog (Tauri v2 + React/TS)
Full working app with:
- Rust core (mtgc-core): Scryfall ingester, nucleo fuzzy search, SQLite two-DB
architecture (reference.db + library.db via ATTACH), criteria filters, deck ops
- Tauri v2 shell exposing the core as typed IPC commands
- React/TS frontend: card entry, library browser, deck editor
- Features: fuzzy card search, color/CMC/type/commander-identity filters,
tile/list view toggle, hover card previews, deck format + commander support,
per-card location field, grouping by type/subtype/CMC/color, localStorage
persistence for active tab/deck/grouping, Discord-inspired dark UI (#C8553D accent)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 19:37:56 -05:00
|
|
|
//! CLI: build reference.db from Scryfall bulk data.
|
|
|
|
|
//!
|
|
|
|
|
//! Usage: `mtgc-ingest [path/to/reference.db]` (defaults to ./reference.db)
|
|
|
|
|
|
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
use std::process::ExitCode;
|
|
|
|
|
|
2026-07-07 20:22:31 -05:00
|
|
|
use mtgc_core::ingest::CancelToken;
|
|
|
|
|
|
Initial commit: MTG personal library catalog (Tauri v2 + React/TS)
Full working app with:
- Rust core (mtgc-core): Scryfall ingester, nucleo fuzzy search, SQLite two-DB
architecture (reference.db + library.db via ATTACH), criteria filters, deck ops
- Tauri v2 shell exposing the core as typed IPC commands
- React/TS frontend: card entry, library browser, deck editor
- Features: fuzzy card search, color/CMC/type/commander-identity filters,
tile/list view toggle, hover card previews, deck format + commander support,
per-card location field, grouping by type/subtype/CMC/color, localStorage
persistence for active tab/deck/grouping, Discord-inspired dark UI (#C8553D accent)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 19:37:56 -05:00
|
|
|
fn main() -> ExitCode {
|
|
|
|
|
let dest = std::env::args()
|
|
|
|
|
.nth(1)
|
|
|
|
|
.map(PathBuf::from)
|
|
|
|
|
.unwrap_or_else(|| PathBuf::from("reference.db"));
|
|
|
|
|
|
|
|
|
|
eprintln!("Building reference db at {}", dest.display());
|
2026-07-07 20:22:31 -05:00
|
|
|
let cancel = CancelToken::new();
|
2026-10-30 20:15:34 -05:00
|
|
|
let built = mtgc_core::ingest::build_reference_db(&dest, &cancel, |p| {
|
2026-07-07 20:22:31 -05:00
|
|
|
eprintln!(" [{}] {:.1}% {}", p.stage, p.overall_percent, p.message)
|
2026-10-30 20:15:34 -05:00
|
|
|
})
|
|
|
|
|
.and_then(|(tmp, stats)| {
|
|
|
|
|
mtgc_core::ingest::install_reference_db(&tmp, &dest)?;
|
|
|
|
|
Ok(stats)
|
|
|
|
|
});
|
|
|
|
|
match built {
|
Initial commit: MTG personal library catalog (Tauri v2 + React/TS)
Full working app with:
- Rust core (mtgc-core): Scryfall ingester, nucleo fuzzy search, SQLite two-DB
architecture (reference.db + library.db via ATTACH), criteria filters, deck ops
- Tauri v2 shell exposing the core as typed IPC commands
- React/TS frontend: card entry, library browser, deck editor
- Features: fuzzy card search, color/CMC/type/commander-identity filters,
tile/list view toggle, hover card previews, deck format + commander support,
per-card location field, grouping by type/subtype/CMC/color, localStorage
persistence for active tab/deck/grouping, Discord-inspired dark UI (#C8553D accent)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 19:37:56 -05:00
|
|
|
Ok(stats) => {
|
|
|
|
|
eprintln!(
|
|
|
|
|
"Done: {} oracle cards, {} printings.",
|
|
|
|
|
stats.oracle_cards, stats.printings
|
|
|
|
|
);
|
|
|
|
|
ExitCode::SUCCESS
|
|
|
|
|
}
|
|
|
|
|
Err(e) => {
|
|
|
|
|
eprintln!("Ingest failed: {e}");
|
|
|
|
|
ExitCode::FAILURE
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|