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.")