Fixed a federation issue related to images

This commit is contained in:
Eliot Berriot 2020-02-04 14:24:20 +01:00
parent 93c371fe75
commit b38cec3f69
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
3 changed files with 72 additions and 39 deletions

View file

@ -302,7 +302,12 @@ def process_upload(upload, update_denormalization=True):
def get_cover(obj, field):
cover = obj.get(field)
if cover:
return {"mimetype": cover["mediaType"], "url": cover["href"]}
try:
url = cover["url"]
except KeyError:
url = cover["href"]
return {"mimetype": cover["mediaType"], "url": url}
def federation_audio_track_to_metadata(payload, references):