fix: resolve_clans drops unresolved placeholders to allow tag fallback

Squads with dash-wrapped tags (e.g. -DSPLA-) store the full tag in the
replay's team.squadron field rather than the bare short name. The short
lookup fails and returns a placeholder whose short_name blocks the tag
lookup, leaving squadron_long as "<unresolved>" and producing no point
diffs on scoreboards. Fix: only include successfully resolved clans
(clan_id is not None) in results and resolved_shorts so the tag pass
still runs for any failed short lookup. Affects all 186 dash-tagged squads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-05-29 16:42:23 +00:00
parent c08fd9c42b
commit 5d972d7314
+8 -4
View File
@@ -986,19 +986,23 @@ async def resolve_clans(shorts: Optional[List[str]] = None, tags: Optional[List[
shorts = shorts or []
tags = tags or []
# Process shorts first
# Process shorts first — only keep successful resolutions (clan_id present).
# Unresolved placeholders must not block the tag pass below, because some
# replays store the tagged form (e.g. "-DSPLA-") in the squadron field
# rather than the bare short name ("DSPLA"), causing the short lookup to
# miss even though the tag lookup would succeed.
for short in shorts:
if short:
result = await resolve_clan(short=short)
if result:
if result and result.get("clan_id") is not None:
results.append(result)
# Then process tags (for any not already resolved)
# Then process tags (for any not already resolved by a successful short lookup)
resolved_shorts = {r["short_name"].lower() for r in results}
for tag in tags:
if tag and tag.lower() not in resolved_shorts:
result = await resolve_clan(tag=tag)
if result:
if result and result.get("clan_id") is not None:
results.append(result)
return results