Remove importcards command

This commit is contained in:
The Magician 2024-05-21 15:16:43 +01:00
parent 9fa8bb563f
commit 07e8277a00
1 changed files with 0 additions and 31 deletions

View File

@ -1,31 +0,0 @@
package main
import (
"encoding/json"
"io/ioutil"
"log"
"sevenkeys/database/operations"
"sevenkeys/scryfall/types"
)
func check(err error) {
if err != nil {
log.Fatal(err)
}
}
func main() {
if updatedAtTimestamp.After(cachedFileTimestamp) {
} else {
log.Printf("Bulk data has not been updated. Skipping download.")
}
var allCards []types.Card
allCardsBytes, err := ioutil.ReadFile(ALL_CARDS_CACHE_FILENAME)
check(err)
err = json.Unmarshal(allCardsBytes, &allCards)
check(err)
operations.InsertCards(db, allCards)
}