Skip to content

Commit

Permalink
fix: Preserve filenames from Telegram for music files (fixes ehForwar…
Browse files Browse the repository at this point in the history
  • Loading branch information
blueset committed Apr 24, 2022
1 parent 1794dd9 commit ead1a9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Fixed
-----
- Attempt to fix “Database is Locked” issue. (`#110`_ by whtsky)
- Telegram GIF image processing may trigger an early download
- Preserve filenames from Telegram for music files (`#117`_)

2.2.4_ - 2021-05-22
===================
Expand Down Expand Up @@ -201,3 +202,4 @@ First release.
.. _#104: https://etm.1a23.studio/issues/104
.. _#110: https://etm.1a23.studio/pull/110
.. _#116: https://etm.1a23.studio/issues/116
.. _#117: https://etm.1a23.studio/issues/117
2 changes: 1 addition & 1 deletion efb_telegram_master/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.2.5.dev3"
__version__ = "2.2.5.dev4"
3 changes: 1 addition & 2 deletions efb_telegram_master/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ def put_telegram_file(self, message: telegram.Message):
self.file_id = message.audio.file_id
self.file_unique_id = message.audio.file_unique_id
self.mime = message.audio.mime_type
extension = mimetypes.guess_extension(message.audio.mime_type or "audio/ogg")
self.filename = f"{message.audio.title} - {message.audio.performer}{extension}"
self.filename = message.audio.file_name
elif self.type_telegram is TGMsgType.Sticker:
assert message.sticker
self.file_id = message.sticker.file_id
Expand Down

0 comments on commit ead1a9f

Please sign in to comment.