3.0.2- rollback

This commit is contained in:
2026-01-29 12:18:05 +08:00
parent 066a0ce719
commit 3bb3d61c2e
8 changed files with 55 additions and 146 deletions

View File

@@ -733,19 +733,16 @@ 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:
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
try:
raw_ids = json.loads(lineups[0]['player_ids_json'])
active_roster_ids = [str(uid) for uid in raw_ids]
except:
pass
if not active_roster_ids:
return None
@@ -755,8 +752,11 @@ 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:
return None
stats_map[target_steam_id] = {}
metrics = [
# TIER 1: CORE