remove etched part of analysis

This commit is contained in:
Florian Baumann 2023-04-27 07:47:04 +02:00
parent 578ad203ca
commit 7b6addcb05
3 changed files with 3 additions and 6 deletions

View File

@ -22,7 +22,8 @@ an overview in what cards you own and what value they have.
**What Serra does not**
* Does not give a shit about conditions (NM, M, GD...)
* Does not care about conditions (NM, M, GD...)
* Does not track etched cards. Only normal and foil.
# Quickstart

View File

@ -54,14 +54,13 @@ var statsCmd = &cobra.Command{
{"value_foil", bson.D{{"$sum", bson.D{{"$multiply", bson.A{getCurrencyField(true), "$serra_count_foil"}}}}}},
{"count", bson.D{{"$sum", bson.D{{"$multiply", bson.A{1.0, "$serra_count"}}}}}},
{"count_foil", bson.D{{"$sum", "$serra_count_foil"}}},
{"count_etched", bson.D{{"$sum", "$serra_count_etched"}}},
{"rarity", bson.D{{"$sum", "$rarity"}}},
{"unique", bson.D{{"$sum", 1}}},
}},
},
bson.D{
{"$addFields", bson.D{
{"count_all", bson.D{{"$sum", bson.A{"$count", "$count_foil", "$count_etched"}}}},
{"count_all", bson.D{{"$sum", bson.A{"$count", "$count_foil"}}}},
}},
},
})
@ -71,7 +70,6 @@ var statsCmd = &cobra.Command{
fmt.Printf("Unique: %s%d%s\n", Purple, stats[0]["unique"], Reset)
fmt.Printf("Normal: %s%.0f%s\n", Purple, stats[0]["count"], Reset)
fmt.Printf("Foil: %s%d%s\n", Purple, stats[0]["count_foil"], Reset)
fmt.Printf("Etched: %s%d%s\n", Purple, stats[0]["count_etched"], Reset)
reserved, _ := coll.storageAggregate(mongo.Pipeline{
bson.D{

View File

@ -36,7 +36,6 @@ var updateCmd = &cobra.Command{
bson.D{
{"serra_count", true},
{"serra_count_foil", true},
{"serra_count_etched", true},
{"set", true},
{"last_price", bson.D{{"$arrayElemAt", bson.A{"$serra_prices", -1}}}}}}}
groupStage := bson.D{
@ -45,7 +44,6 @@ var updateCmd = &cobra.Command{
{"eur", bson.D{{"$sum", bson.D{{"$multiply", bson.A{"$last_price.eur", "$serra_count"}}}}}},
{"eurfoil", bson.D{{"$sum", bson.D{{"$multiply", bson.A{"$last_price.eur_foil", "$serra_count_foil"}}}}}},
{"usd", bson.D{{"$sum", bson.D{{"$multiply", bson.A{"$last_price.usd", "$serra_count"}}}}}},
{"usdetched", bson.D{{"$sum", bson.D{{"$multiply", bson.A{"$last_price.usd_etched", "$serra_count_etched"}}}}}},
{"usdfoil", bson.D{{"$sum", bson.D{{"$multiply", bson.A{"$last_price.usd_foil", "$serra_count_foil"}}}}}},
}}}