diff --git a/app/routers_v2/refractor.py b/app/routers_v2/refractor.py index d28aba2..1477a01 100644 --- a/app/routers_v2/refractor.py +++ b/app/routers_v2/refractor.py @@ -1,4 +1,5 @@ import os +from datetime import date from fastapi import APIRouter, Depends, HTTPException, Query import logging @@ -476,9 +477,15 @@ async def evaluate_game(game_id: int, token: str = Depends(oauth2_scheme)): # Non-breaking addition: include boost info when available. if boost_result: - tier_up_entry["variant_created"] = boost_result.get( - "variant_created" - ) + variant_num = boost_result.get("variant_created") + tier_up_entry["variant_created"] = variant_num + if computed_tier >= 3 and variant_num and card_type: + d = date.today().strftime("%Y-%m-%d") + api_base = os.environ.get("API_BASE_URL", "").rstrip("/") + tier_up_entry["animated_url"] = ( + f"{api_base}/api/v2/players/{player_id}/{card_type}card" + f"/{d}/{variant_num}/animated" + ) tier_ups.append(tier_up_entry)