fix: missing filename attribute

This commit is contained in:
Dineshkarthik 2020-07-15 12:44:46 +02:00
parent 1df2762963
commit cf46b35639

View file

@ -61,10 +61,10 @@ async def _get_media_meta(
dt.utcfromtimestamp(media_obj.date).isoformat(), file_format
),
)
elif _type in ["photo", "video"]:
file_name = os.path.join(THIS_DIR, _type, "")
else:
file_name = os.path.join(THIS_DIR, _type, media_obj.file_name)
file_name = os.path.join(
THIS_DIR, _type, getattr(media_obj, "file_name", None) or ""
)
return file_ref, file_name, file_format