attribution is a list

main
Bob Mottram 2023-05-17 21:52:59 +01:00
parent 51c97949f1
commit 9d9b1a2732
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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 = ''