Repository: mtgjson/mtgjson

Issue:
Change Cardmarket price from 1-day Average to Price Trend
I’d like to suggest replacing the current Cardmarket 1-day average price with the "Price Trend" metric. The Price Trend is the standard reference used by most EU players and traders, offering a more stable and accurate reflection of card values. Switching to the Price Trend would make your data more relevant and useful for EU users.

Thank you for the great work on this project!

Discussion:

Patch:
diff --git a/mtgjson5/providers/cardmarket/monolith.py b/mtgjson5/providers/cardmarket/monolith.py
index 2b5d7ae..a54599a 100644
--- a/mtgjson5/providers/cardmarket/monolith.py
+++ b/mtgjson5/providers/cardmarket/monolith.py
@@ -78,10 +78,12 @@ class CardMarketProvider(AbstractProvider):
         for mkm_entry in data:
             product_id = str(mkm_entry["idProduct"])
             price_data[product_id] = {
-                "avg1": (float(mkm_entry["avg1"]) if mkm_entry.get("avg1") else None),
-                "avg1-foil": (
-                    float(mkm_entry["avg1-foil"])
-                    if mkm_entry.get("avg1-foil")
+                "trend": (
+                    float(mkm_entry["trend"]) if mkm_entry.get("trend") else None
+                ),
+                "trend-foil": (
+                    float(mkm_entry["trend-foil"])
+                    if mkm_entry.get("trend-foil")
                     else None
                 ),
             }
@@ -111,8 +113,8 @@ class CardMarketProvider(AbstractProvider):
 
         today_dict: Dict[str, MtgjsonPricesObject] = {}
         for product_id, price_entities in price_data.items():
-            avg_sell_price = price_entities.get("avg1")
-            avg_foil_price = price_entities.get("avg1-foil")
+            avg_sell_price = price_entities.get("trend")
+            avg_foil_price = price_entities.get("trend-foil")
 
             if product_id in mtgjson_id_map:
                 mtgjson_uuids = mtgjson_id_map[product_id]


Test patch:
diff --git a/tests/mtgjson5/resources/today_price_builder/card_market_api_response.json b/tests/mtgjson5/resources/today_price_builder/card_market_api_response.json
index b8fe64d..26dd719 100644
--- a/tests/mtgjson5/resources/today_price_builder/card_market_api_response.json
+++ b/tests/mtgjson5/resources/today_price_builder/card_market_api_response.json
@@ -4,12 +4,12 @@
     "priceGuides": [
         {
             "idProduct": 1,
-            "avg1": 111.01,
-            "avg1-foil": 222.01
+            "trend": 111.01,
+            "trend-foil": 222.01
         },
         {
             "idProduct": 2,
-            "avg1-foil": 333.01
+            "trend-foil": 333.01
         }
     ]
 }
\ No newline at end of file