mirror of
https://github.com/Dineshkarthik/telegram_media_downloader.git
synced 2024-09-20 15:26:32 +08:00
Merge pull request #25 from Dineshkarthik/fix-missing-filename-attribute
Fix: Missing File-name attribute
This commit is contained in:
commit
de7273a54e
13
codecov.yml
Normal file
13
codecov.yml
Normal 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
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue