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:
parent
d50d1c07f6
commit
a2c1f81644
2 changed files with 7 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue