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:
+8
-4
@@ -986,19 +986,23 @@ async def resolve_clans(shorts: Optional[List[str]] = None, tags: Optional[List[
|
|||||||
shorts = shorts or []
|
shorts = shorts or []
|
||||||
tags = tags 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:
|
for short in shorts:
|
||||||
if short:
|
if short:
|
||||||
result = await resolve_clan(short=short)
|
result = await resolve_clan(short=short)
|
||||||
if result:
|
if result and result.get("clan_id") is not None:
|
||||||
results.append(result)
|
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}
|
resolved_shorts = {r["short_name"].lower() for r in results}
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
if tag and tag.lower() not in resolved_shorts:
|
if tag and tag.lower() not in resolved_shorts:
|
||||||
result = await resolve_clan(tag=tag)
|
result = await resolve_clan(tag=tag)
|
||||||
if result:
|
if result and result.get("clan_id") is not None:
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|||||||
Reference in New Issue
Block a user