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

@@ -78,12 +78,8 @@ class FeatureService:
}
for legacy_key, l3_key in alias_map.items():
legacy_val = f.get(legacy_key)
l3_val = f.get(l3_key)
if legacy_val is None and l3_val is not None:
f[legacy_key] = l3_val
elif l3_val is None and legacy_val is not None:
f[l3_key] = legacy_val
if legacy_key not in f or f.get(legacy_key) is None:
f[legacy_key] = f.get(l3_key)
if f.get("matches_played") is None:
f["matches_played"] = f.get("total_matches", 0) or 0

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