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

@@ -78,8 +78,12 @@ class FeatureService:
}
for legacy_key, l3_key in alias_map.items():
if legacy_key not in f or f.get(legacy_key) is None:
f[legacy_key] = f.get(l3_key)
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 f.get("matches_played") is None:
f["matches_played"] = f.get("total_matches", 0) or 0

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