3.0.1: fix

This commit is contained in:
2026-01-29 03:17:24 +08:00
parent 04ee957af6
commit 066a0ce719
10 changed files with 294 additions and 132 deletions

View File

@@ -733,16 +733,19 @@ class StatsService:
from web.services.feature_service import FeatureService
import json
# 1. Get Active Roster IDs
lineups = WebService.get_lineups()
active_roster_ids = []
target_steam_id = str(target_steam_id)
if lineups:
try:
raw_ids = json.loads(lineups[0]['player_ids_json'])
active_roster_ids = [str(uid) for uid in raw_ids]
except:
pass
for lineup in lineups:
try:
raw_ids = json.loads(lineup.get('player_ids_json') or '[]')
roster_ids = [str(uid) for uid in raw_ids]
if target_steam_id in roster_ids:
active_roster_ids = roster_ids
break
except Exception:
continue
if not active_roster_ids:
return None
@@ -752,11 +755,8 @@ class StatsService:
return None
stats_map = {str(row["steam_id_64"]): FeatureService._normalize_features(dict(row)) for row in rows}
target_steam_id = str(target_steam_id)
# If target not in map (e.g. no L3 data), try to add empty default
if target_steam_id not in stats_map:
stats_map[target_steam_id] = {}
return None
metrics = [
# TIER 1: CORE