Validate and regenerate all seed data from PokeDB
- Regenerate seed JSON for all 37 games with more complete PokeDB data
- Add category field to games.json (original/enhanced/remake/sequel/spinoff)
- Include all 1350 pokemon in pokemon.json with types and local sprites
- Build reverse index for PokeDB form lookups (types/sprites for evolutions)
- Move sprites to frontend/public/sprites, reference as /sprites/{id}.webp
- Truncate Sw/Sh den names to fit DB VARCHAR(100) limit
- Deduplicate route names and merge unnamed child areas into parent routes
- Populate 7 previously empty games (Sw/Sh, BDSP, PLA, Sc/Vi)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -311,28 +311,33 @@ def build_routes(
|
||||
else:
|
||||
# Multiple areas — check if encounters differ
|
||||
children: list[Route] = []
|
||||
all_encounters: list[Encounter] = []
|
||||
# Encounters for areas with no distinct name get merged into parent
|
||||
parent_encounters: list[Encounter] = []
|
||||
|
||||
for _, area_name, encounters in areas:
|
||||
aggregated = aggregate_encounters(encounters)
|
||||
if aggregated:
|
||||
if area_name and area_name != loc_name:
|
||||
child_name = area_name
|
||||
children.append(Route(name=area_name, order=0, encounters=aggregated))
|
||||
else:
|
||||
child_name = loc_name
|
||||
children.append(Route(name=child_name, order=0, encounters=aggregated))
|
||||
all_encounters.extend(encounters)
|
||||
# No distinct area name — merge into parent
|
||||
parent_encounters.extend(aggregated)
|
||||
|
||||
if len(children) > 1:
|
||||
# Parent with children
|
||||
if children:
|
||||
# Parent with children (parent may also have its own encounters)
|
||||
parent_agg = aggregate_encounters(parent_encounters) if parent_encounters else []
|
||||
routes.append(Route(
|
||||
name=loc_name,
|
||||
order=0,
|
||||
encounters=[],
|
||||
encounters=parent_agg,
|
||||
children=children,
|
||||
))
|
||||
elif len(children) == 1:
|
||||
# Only one area had encounters — flatten
|
||||
routes.append(children[0])
|
||||
elif parent_encounters:
|
||||
# All areas had same name — flatten into single route
|
||||
routes.append(Route(
|
||||
name=loc_name,
|
||||
order=0,
|
||||
encounters=aggregate_encounters(parent_encounters),
|
||||
))
|
||||
|
||||
return routes
|
||||
|
||||
Reference in New Issue
Block a user