add photo thumbnail to dict_nicely to allow visualizing in the ui

This commit is contained in:
Viktor Barzin 2025-05-31 21:57:03 +00:00
parent c7a2b23967
commit 18b0e39495
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863

View file

@ -310,6 +310,14 @@ class Listing:
return self.detailobject['property']["councilTaxInfo"]["content"][0][
"value"]
@property
def photoThumbnail(self) -> str | None:
# options are: 'url', 'thumbnailUrl', 'maxSizeUrl'
photos = self.detailobject['property']['photos']
if len(photos) > 0:
return photos[0]['url']
return None
async def dict_nicely(self):
travel_time_fastest = {}
travel_time_second = {}
@ -366,6 +374,8 @@ class Listing:
self.agency,
"council_tax_band":
self.councilTaxBand,
"photo_thumbnail":
self.photoThumbnail,
}
def __routing_cache_key(