get description only for images, for now

This commit is contained in:
Manuel Cortez 2022-11-11 15:05:56 -06:00
parent f24f97baae
commit 97815f807a
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -35,11 +35,11 @@ def process_image_descriptions(media_attachments):
""" Attempt to extract information for image descriptions. """ """ Attempt to extract information for image descriptions. """
image_descriptions = [] image_descriptions = []
for media in media_attachments: for media in media_attachments:
if media.get("description") != None: if media.get("description", "") != "":
image_descriptions.append(media.get("description")) image_descriptions.append(media.get("description"))
idescriptions = "" idescriptions = ""
for image in image_descriptions: for image in image_descriptions:
idescriptions += _("Image description: {}").format(image) idescriptions = idescriptions + _("Image description: {}").format(image) + " "
return idescriptions return idescriptions
def remove_unneeded_variables(template, variables): def remove_unneeded_variables(template, variables):