Remove importcards command
This commit is contained in:
parent
9fa8bb563f
commit
07e8277a00
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue