Skip to content

Commit

Permalink
as2.to_as1: handle bare string images
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed May 11, 2024
1 parent e809317 commit d92f4dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions granary/as2.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ def all_to_as1(field):
images = util.pop_list(obj, 'image')
# by convention, first element in AS2 images field is banner/header
if type in ACTOR_TYPES and images:
if isinstance(images[0], str):
images[0] = {'url': images[0]}
images[0]['objectType'] = 'featured'

img_atts = [a for a in attachments
Expand Down

0 comments on commit d92f4dc

Please sign in to comment.