mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Fixed loss of thumbnails after media editing. (#216)
This commit is contained in:
parent
c05e008656
commit
69f347ddec
@ -123,6 +123,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=mimetypes.types_map[".mp4"],
|
mime_type=mimetypes.types_map[".mp4"],
|
||||||
|
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
||||||
file=self.save_file(media.media),
|
file=self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeVideo(
|
types.DocumentAttributeVideo(
|
||||||
@ -179,6 +180,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=mimetypes.types_map.get("." + media.media.split(".")[-1], "audio/mpeg"),
|
mime_type=mimetypes.types_map.get("." + media.media.split(".")[-1], "audio/mpeg"),
|
||||||
|
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
||||||
file=self.save_file(media.media),
|
file=self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeAudio(
|
types.DocumentAttributeAudio(
|
||||||
@ -234,6 +236,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=mimetypes.types_map[".mp4"],
|
mime_type=mimetypes.types_map[".mp4"],
|
||||||
|
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
||||||
file=self.save_file(media.media),
|
file=self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeVideo(
|
types.DocumentAttributeVideo(
|
||||||
@ -291,6 +294,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=mimetypes.types_map.get("." + media.media.split(".")[-1], "text/plain"),
|
mime_type=mimetypes.types_map.get("." + media.media.split(".")[-1], "text/plain"),
|
||||||
|
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
||||||
file=self.save_file(media.media),
|
file=self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeFilename(os.path.basename(media.media))
|
types.DocumentAttributeFilename(os.path.basename(media.media))
|
||||||
|
Loading…
Reference in New Issue
Block a user