Post another map image if the area/geometry has been modified
This commit is contained in:
parent
000acf19e3
commit
6ca6a2dbd1
1 changed files with 6 additions and 0 deletions
6
scl.py
6
scl.py
|
@ -373,6 +373,7 @@ with Session(engine) as session:
|
|||
existing_record = lookup_result.one()
|
||||
updated_properties = []
|
||||
updated_entries = []
|
||||
map_media_post = None
|
||||
|
||||
est_restoration_diff_mins = (
|
||||
abs(
|
||||
|
@ -415,8 +416,12 @@ with Session(engine) as session:
|
|||
max_event_class = classify_event_size(existing_record.max_num_people)
|
||||
if existing_record.outage_geometries != outage_geometries:
|
||||
print("Geometries modified")
|
||||
updated_properties.append("area")
|
||||
existing_record.outage_geometries = outage_geometries
|
||||
existing_record.geometries_modified = True
|
||||
map_media_post, _ = generate_post_map_image(
|
||||
event, event_class, outage_geometries
|
||||
)
|
||||
|
||||
if updated_properties:
|
||||
updated_properties.sort()
|
||||
|
@ -441,6 +446,7 @@ with Session(engine) as session:
|
|||
post_result = mastodon_client.status_post(
|
||||
status="\n".join(updated_entries),
|
||||
in_reply_to_id=existing_record.most_recent_post_id,
|
||||
media_ids=map_media_post,
|
||||
visibility="public",
|
||||
language="en",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue