2024-09-23 21:03:31 +00:00
|
|
|
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 + "n"
|
|
|
|
} else {
|
|
|
|
cardPrintingId = card.ScryfallID + "f"
|
|
|
|
}
|
|
|
|
|
|
|
|
cardLocation := database.CardLocation{
|
|
|
|
CardPrintingId: cardPrintingId,
|
|
|
|
StorageAreaId: storageAreaId,
|
|
|
|
}
|
|
|
|
|
2024-09-25 10:48:01 +00:00
|
|
|
StoreCard(db, cardLocation)
|
2024-09-23 21:03:31 +00:00
|
|
|
}
|
2024-09-25 10:48:01 +00:00
|
|
|
|
|
|
|
return nil
|
2024-09-23 21:03:31 +00:00
|
|
|
}
|