diff --git a/sevenkeys/main.go b/sevenkeys/main.go index b38c789..753fc7a 100644 --- a/sevenkeys/main.go +++ b/sevenkeys/main.go @@ -1,8 +1,9 @@ package main import ( - "fmt" "log" + "sevenkeys/database" + "sevenkeys/scryfall/methods" ) const CACHE_DIR string = "cache" @@ -19,5 +20,24 @@ func check(err error) { } func main() { - fmt.Println("Hello, world") + log.Println("Connecting to database...") + db := database.GetDatabaseFromConfig("config.json") + log.Println("Connected.") + + log.Println("Downloading set data from Scryfall...") + sets, err := methods.GetSets() + check(err) + log.Println("Downloaded set data.") + + // Create cache dir + // Create icon cache dir + + // Loop through sets, import set data into database and download icons + // TODO: Only download icon if we don't already have the file + + // Check whether card data has been updated since last download + // If yes, redownload and recache the bulk data + + // Unmarshal cached file into Golang struct + // Import cards into database }