Add PokeDB sprite downloading (100x100 WebP)
Download pokemon sprites from PokeDB CDN during import, cached locally
as {pokeapi_id}.webp. Replaces PokeAPI GitHub sprite URLs. ~4.6MB for
all 1119 unique sprites.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -464,6 +464,19 @@ class PokemonMapper:
|
||||
|
||||
return None
|
||||
|
||||
def get_sprite_url(self, pokemon_form_identifier: str | None) -> str | None:
|
||||
"""Get the PokeDB CDN sprite URL (100x100 medium) for a form identifier."""
|
||||
if not pokemon_form_identifier:
|
||||
return None
|
||||
form_record = self._pokedb_form_index.get(pokemon_form_identifier, {})
|
||||
return form_record.get("main_image_normal_path_medium")
|
||||
|
||||
def get_form_data(self, pokemon_form_identifier: str | None) -> dict | None:
|
||||
"""Get the full PokeDB form record for a form identifier."""
|
||||
if not pokemon_form_identifier:
|
||||
return None
|
||||
return self._pokedb_form_index.get(pokemon_form_identifier)
|
||||
|
||||
def report_unmapped(self) -> None:
|
||||
"""Print warnings for any unmapped identifiers."""
|
||||
if self._unmapped:
|
||||
|
||||
Reference in New Issue
Block a user