From 411383704ca4b950ee5d4456ef0f75994f3ff319 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 21 May 2024 13:25:08 +0100 Subject: [PATCH] Import set data --- sevenkeys/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sevenkeys/main.go b/sevenkeys/main.go index 8233716..d1c90bb 100644 --- a/sevenkeys/main.go +++ b/sevenkeys/main.go @@ -48,7 +48,7 @@ func importSets(db *sql.DB, sets []types.Set) error { } log.Println("Importing " + set.Code) - err = operations.InsertOrUpdateSet(db, set) + err := operations.InsertOrUpdateSet(db, set) if err != nil { return err } @@ -69,6 +69,8 @@ func importSets(db *sql.DB, sets []types.Set) error { io.Copy(iconFile, response.Body) log.Println("Finished importing " + set.Code) } + + return nil } func main() { @@ -77,7 +79,7 @@ func main() { log.Println("Connected.") log.Println("Creating cache directories...") - err = createCacheDirectories() + err := createCacheDirectories() check(err) log.Println("Created cache directories.") @@ -86,10 +88,8 @@ func main() { check(err) log.Println("Downloaded set data.") - // Loop through sets, import set data into database and download icons - // TODO: Only download icon if we don't already have the file log.Println("Importing set data...") - err = importSets() + err = importSets(db, sets) check(err) log.Println("Imported sets.")