mirror of https://gitlab.com/bashrc2/epicyon
attribution is a list
parent
51c97949f1
commit
9d9b1a2732
2
media.py
2
media.py
|
@ -633,7 +633,7 @@ def attach_media(base_dir: str, http_prefix: str,
|
|||
attachment_json['license'] = content_license_url
|
||||
if creator:
|
||||
attachment_json['schema:creator'] = creator
|
||||
attachment_json['attribution'] = creator
|
||||
attachment_json['attribution'] = [creator]
|
||||
if media_type.startswith('image/'):
|
||||
attachment_json['blurhash'] = _get_blur_hash()
|
||||
# find the dimensions of the image and add them as metadata
|
||||
|
|
|
@ -1297,12 +1297,13 @@ def get_post_attachments_as_html(base_dir: str,
|
|||
system_language):
|
||||
media_creator = attach['schema:creator']
|
||||
elif attach.get('attribution'):
|
||||
if len(attach['attribution']) < 120:
|
||||
if not dangerous_markup(attach['attribution'], False):
|
||||
if not is_filtered(base_dir, nickname, domain,
|
||||
attach['attribution'],
|
||||
system_language):
|
||||
media_creator = attach['attribution']
|
||||
if isinstance(attach['attribution'], list):
|
||||
if len(attach['attribution']) > 0:
|
||||
attrib_str = attach['attribution'][0]
|
||||
if not dangerous_markup(attrib_str, False):
|
||||
if not is_filtered(base_dir, nickname, domain,
|
||||
attrib_str, system_language):
|
||||
media_creator = attrib_str
|
||||
|
||||
media_type = attach['mediaType']
|
||||
image_description = ''
|
||||
|
|
Loading…
Reference in New Issue