use thumbnail image for videos when updating #366

This commit is contained in:
rimu 2024-12-03 09:25:10 +13:00
parent 36b272e797
commit 82be9f9475

View file

@ -1862,6 +1862,9 @@ def update_post_from_activity(post: Post, request_json: dict):
image.alt_text = request_json['object']['attachment'][0]['name'] image.alt_text = request_json['object']['attachment'][0]['name']
elif is_video_url(new_url): elif is_video_url(new_url):
post.type = POST_TYPE_VIDEO post.type = POST_TYPE_VIDEO
if 'image' in request_json['object'] and 'url' in request_json['object']['image']:
image = File(source_url=request_json['object']['image']['url'])
else:
image = File(source_url=new_url) image = File(source_url=new_url)
else: else:
if 'image' in request_json['object'] and 'url' in request_json['object']['image']: if 'image' in request_json['object'] and 'url' in request_json['object']['image']: