mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
use thumbnail image for videos #366
This commit is contained in:
parent
04cce6ec9d
commit
36b272e797
1 changed files with 4 additions and 1 deletions
|
@ -1259,7 +1259,10 @@ class Post(db.Model):
|
|||
post.image = image
|
||||
elif is_video_url(post.url): # youtube is detected later
|
||||
post.type = constants.POST_TYPE_VIDEO
|
||||
image = File(source_url=post.url)
|
||||
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=post.url)
|
||||
db.session.add(image)
|
||||
post.image = image
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue