From d0bdd7a55cb61dbcfb7876fde22442fce5ae7337 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 26 Apr 2025 14:04:27 +0100 Subject: [PATCH] Add address to location --- posts.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/posts.py b/posts.py index f4d073640..f4d2f616d 100644 --- a/posts.py +++ b/posts.py @@ -1398,10 +1398,13 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int, 'type': 'Place', 'name': location['name'] } - if location.get('url'): - if isinstance(location['url'], str): - if resembles_url(location['url']): - new_post['object']['location']['url'] = location['url'] + if location.get('address'): + if isinstance(location['address'], str): + new_post['object']['location']['address'] = location['address'] + if location.get('url'): + if isinstance(location['url'], str): + if resembles_url(location['url']): + new_post['object']['location']['url'] = location['url'] if attach_image_filename: new_post['object'] = \ attach_media(base_dir, http_prefix, nickname, domain, port, @@ -1533,10 +1536,13 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int, 'type': 'Place', 'name': location['name'] } - if location.get('url'): - if isinstance(location['url'], str): - if resembles_url(location['url']): - new_post['object']['location']['url'] = location['url'] + if location.get('address'): + if isinstance(location['address'], str): + new_post['object']['location']['address'] = location['address'] + if location.get('url'): + if isinstance(location['url'], str): + if resembles_url(location['url']): + new_post['object']['location']['url'] = location['url'] if attach_image_filename: new_post = \