Merge pull request 'feat: include animated_url in tier-up response for T3/T4 (#201)' (#208) from issue/201-feat-include-animated-url-in-tier-up-response-for into main
This commit is contained in:
commit
7701777273
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user