import { DBReader } from "./src/dbreader";
import { NWFetcher } from "./src/nwfetcher";
import _ from "underscore";
import { CNOCGFetcher } from "./src/cnocg";
import { ExtraCards } from "./src/ExtraCards";
import { DirectFetcher } from "./src/direct";

async function main() {
	const dbreader = new DBReader({ name: "Database" });
	await dbreader.init();
	//const cards = await CNOCGFetcher.fetchOnce();
	//const missingExtraCards = ExtraCards.filter(c => !cards.some(cc => c.code === cc.code));
	//await dbreader.run(cards.concat(missingExtraCards));
	const cards = await DirectFetcher.fetchOnce();
	//console.log(cards);
	await dbreader.run(cards);
	process.exit();
}
main();
