mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
PeerTube: 'icon' is 'Video' post is list
This commit is contained in:
parent
ebeb5420ee
commit
5bb7af84cd
1 changed files with 6 additions and 0 deletions
|
@ -814,6 +814,12 @@ def post_json_to_model(activity_log, post_json, user, community) -> Post:
|
|||
domain.post_count += 1
|
||||
post.domain = domain
|
||||
|
||||
if post_json['type'] == 'Video':
|
||||
if 'icon' in post_json and isinstance(post_json['icon'], list):
|
||||
icon = File(source_url=post_json['icon'][-1]['url'])
|
||||
db.session.add(icon)
|
||||
post.image = icon
|
||||
|
||||
if 'language' in post_json:
|
||||
language = find_language_or_create(post_json['language']['identifier'], post_json['language']['name'])
|
||||
if language:
|
||||
|
|
Loading…
Add table
Reference in a new issue