Merge pull request #25 from Dineshkarthik/fix-missing-filename-attribute

Fix: Missing File-name attribute
This commit is contained in:
DK 2020-07-15 13:07:56 +02:00 committed by GitHub
commit de7273a54e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

13
codecov.yml Normal file
View file

@ -0,0 +1,13 @@
coverage:
status:
project:
default:
target: auto
threshold: 0.5%
if_no_uploads: error
if_not_found: success
if_ci_failed: error
patch: yes
comment:
require_changes: true

View file

@ -61,10 +61,10 @@ async def _get_media_meta(
dt.utcfromtimestamp(media_obj.date).isoformat(), file_format dt.utcfromtimestamp(media_obj.date).isoformat(), file_format
), ),
) )
elif _type in ["photo", "video"]:
file_name = os.path.join(THIS_DIR, _type, "")
else: 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 return file_ref, file_name, file_format