TheMathemagicians/sevenkeys/logic/import.go

28 lines
530 B
Go
Raw Permalink Normal View History

package logic
import (
"database/sql"
"sevenkeys/database"
"sevenkeys/delverlens"
)
func ImportDelverLensCards(db *sql.DB, cards []delverlens.DelverLensCard, storageAreaId int) error {
for _, card := range cards {
var cardPrintingId string
if card.IsFoil {
cardPrintingId = card.ScryfallID + "f"
2024-10-01 13:56:13 +00:00
} else {
cardPrintingId = card.ScryfallID + "n"
}
cardLocation := database.CardLocation{
CardPrintingId: cardPrintingId,
StorageAreaId: storageAreaId,
}
StoreCard(db, cardLocation)
}
return nil
}