Fix missing currency wrappers for outputs in remove,add,missing

This commit is contained in:
Florian Baumann 2023-02-07 10:29:33 +01:00
parent 482217c8f9
commit c42013c0a3
3 changed files with 5 additions and 5 deletions

View File

@ -36,13 +36,13 @@ var addCmd = &cobra.Command{
c := co[0] c := co[0]
if unique { if unique {
LogMessage(fmt.Sprintf("Not adding \"%s\" (%s, %.2f Eur) to Collection because it already exists.", c.Name, c.Rarity, c.Prices.Eur), "red") LogMessage(fmt.Sprintf("Not adding \"%s\" (%s, %.2f %s) to Collection because it already exists.", c.Name, c.Rarity, c.getValue(), getCurrency()), "red")
continue continue
} }
modify_count_of_card(coll, &c, count) modify_count_of_card(coll, &c, count)
// Give feedback of successfully added card // Give feedback of successfully added card
LogMessage(fmt.Sprintf("%dx \"%s\" (%s, %.2f Eur) added to Collection.", c.SerraCount, c.Name, c.Rarity, c.Prices.Eur), "green") LogMessage(fmt.Sprintf("%dx \"%s\" (%s, %.2f %s) added to Collection.", c.SerraCount, c.Name, c.Rarity, c.getValue(), getCurrency()), "green")
// If card is not already in collection, fetching from scyfall // If card is not already in collection, fetching from scyfall
} else { } else {
@ -63,7 +63,7 @@ var addCmd = &cobra.Command{
} }
// Give feedback of successfully added card // Give feedback of successfully added card
LogMessage(fmt.Sprintf("%dx \"%s\" (%s, %.2f Eur) added to Collection.", c.SerraCount, c.Name, c.Rarity, c.Prices.Eur), "green") LogMessage(fmt.Sprintf("%dx \"%s\" (%s, %.2f %s) added to Collection.", c.SerraCount, c.Name, c.Rarity, c.getValue(), getCurrency()), "green")
} }
} }
storage_disconnect(client) storage_disconnect(client)

View File

@ -58,7 +58,7 @@ cards you dont own (yet) :)`,
if err != nil { if err != nil {
continue continue
} }
fmt.Printf("%.02f\t%s (%s)\n", ncard.Prices.Eur, ncard.Name, ncard.SetName) fmt.Printf("%.02f %s\t%s (%s)\n", ncard.getValue(), getCurrency(), ncard.Name, ncard.SetName)
} }
return nil return nil
}, },

View File

@ -38,7 +38,7 @@ var removeCmd = &cobra.Command{
modify_count_of_card(coll, c, -1) modify_count_of_card(coll, c, -1)
} else { } else {
coll.storage_remove(bson.M{"_id": c.ID}) coll.storage_remove(bson.M{"_id": c.ID})
LogMessage(fmt.Sprintf("\"%s\" (%.2f Eur) removed from the Collection.", c.Name, c.Prices.Eur), "green") LogMessage(fmt.Sprintf("\"%s\" (%.2f %s) removed from the Collection.", c.Name, c.getValue(), getCurrency()), "green")
} }
} }