Fix photo extraction: look for both 'photos' and 'images' keys

Rightmove API stores photos under the 'photos' key in the response,
but the GeoJSON export and detail API were only checking 'images'.
This key mismatch caused all listings to fall back to the single
photo_thumbnail. Now checks both keys with fallback.
This commit is contained in:
Viktor Barzin 2026-02-22 01:21:50 +00:00
parent d50d1c07f6
commit a2c1f81644
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 7 additions and 3 deletions

View file

@ -605,7 +605,8 @@ async def get_listing_detail(
description = text_info.get("description") if isinstance(text_info, dict) else None
# Extract photos (prefer high-res maxSizeUrl)
photos_raw = property_info.get("images", [])
# Rightmove API stores photos under "photos" key, but some code paths used "images"
photos_raw = property_info.get("images", []) or property_info.get("photos", [])
photos: list[dict] = []
if isinstance(photos_raw, list):
for img in photos_raw: