Remove unused code
This commit is contained in:
parent
8c683002be
commit
6814b23018
|
@ -1,12 +0,0 @@
|
|||
package logic
|
||||
|
||||
/*
|
||||
func GetAllBlueprints(db *sql.DB) ([]cardtrader.Blueprint, error) {
|
||||
blueprints, err := database.GetAllBlueprints(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return blueprints, nil
|
||||
}
|
||||
*/
|
|
@ -1,11 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"sevenkeys/config"
|
||||
|
@ -13,8 +11,6 @@ import (
|
|||
"sevenkeys/delverlens"
|
||||
"sevenkeys/logic"
|
||||
"sevenkeys/update"
|
||||
|
||||
"github.com/mtgban/go-mtgban/cardtrader"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -27,10 +23,6 @@ const (
|
|||
AddSubcommand string = "add"
|
||||
RemoveSubcommand string = "remove"
|
||||
ReplaceSubcommand string = "replace"
|
||||
DeckSubcommand string = "deck"
|
||||
|
||||
GetProductIdSubcommand string = "products"
|
||||
MatchSubcommands string = "match"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -49,10 +41,9 @@ func main() {
|
|||
|
||||
switch flag.Args()[0] {
|
||||
case UpdateSubcommand:
|
||||
err := update.UpdateScryfallData(db)
|
||||
logic.Check(err)
|
||||
update.UpdateScryfallData(db)
|
||||
|
||||
err = update.UpdateCardtraderData(db, config.CardtraderToken)
|
||||
err := update.UpdateCardtraderData(db, config.CardtraderToken)
|
||||
logic.Check(err)
|
||||
break
|
||||
case CreateStorageAreaSubcommand:
|
||||
|
@ -207,60 +198,6 @@ func main() {
|
|||
err := logic.Replace(db, *cardLocationId, *cardPrintingId)
|
||||
logic.Check(err)
|
||||
break
|
||||
case DeckSubcommand:
|
||||
deckCmd := flag.NewFlagSet(DeckSubcommand, flag.ExitOnError)
|
||||
deckCmd.Parse(flag.Args()[1:])
|
||||
|
||||
//filename := deckCmd.Args()[0]
|
||||
break
|
||||
case GetProductIdSubcommand:
|
||||
blbBlueprintsBytes, err := ioutil.ReadFile("blb_blueprints.json")
|
||||
logic.Check(err)
|
||||
|
||||
var blbBlueprints []cardtrader.Blueprint
|
||||
err = json.Unmarshal(blbBlueprintsBytes, &blbBlueprints)
|
||||
logic.Check(err)
|
||||
|
||||
productsBytes, err := ioutil.ReadFile("products.json")
|
||||
logic.Check(err)
|
||||
|
||||
var products []cardtrader.Product
|
||||
err = json.Unmarshal(productsBytes, &products)
|
||||
logic.Check(err)
|
||||
|
||||
for _, product := range products {
|
||||
var productBlueprint cardtrader.Blueprint
|
||||
for _, blueprint := range blbBlueprints {
|
||||
if blueprint.Id == product.BlueprintId {
|
||||
productBlueprint = blueprint
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("%s %s %d ",
|
||||
productBlueprint.Name,
|
||||
product.Properties.Number,
|
||||
product.Id,
|
||||
)
|
||||
|
||||
if product.Properties.MTGFoil {
|
||||
fmt.Printf("FOIL ")
|
||||
} else {
|
||||
fmt.Printf("NONFOIL ")
|
||||
}
|
||||
|
||||
fmt.Printf("x%d\n", product.Quantity)
|
||||
}
|
||||
break
|
||||
/*
|
||||
case MatchSubcommands:
|
||||
cardLocations, err := logic.GetAllStorageSearchOptions(db)
|
||||
logic.Check(err)
|
||||
|
||||
blueprints, err := logic.GetAllBlueprints(db)
|
||||
logic.Check(err)
|
||||
break
|
||||
*/
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "Unrecognized subcommand: %s\n", os.Args[1])
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue