mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Fix ttl_seconds and thumbs not being optional
This commit is contained in:
parent
5b042a6546
commit
8c2dd9d1c3
@ -42,15 +42,15 @@ class Photo(Object):
|
|||||||
height (``int``):
|
height (``int``):
|
||||||
Photo height.
|
Photo height.
|
||||||
|
|
||||||
ttl_seconds (``int``):
|
|
||||||
Time-to-live seconds, for secret photos.
|
|
||||||
|
|
||||||
file_size (``int``):
|
file_size (``int``):
|
||||||
File size.
|
File size.
|
||||||
|
|
||||||
date (``int``):
|
date (``int``):
|
||||||
Date the photo was sent in Unix time.
|
Date the photo was sent in Unix time.
|
||||||
|
|
||||||
|
ttl_seconds (``int``, *optional*):
|
||||||
|
Time-to-live seconds, for secret photos.
|
||||||
|
|
||||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||||
Available thumbnails of this photo.
|
Available thumbnails of this photo.
|
||||||
"""
|
"""
|
||||||
@ -63,10 +63,10 @@ class Photo(Object):
|
|||||||
file_ref: str,
|
file_ref: str,
|
||||||
width: int,
|
width: int,
|
||||||
height: int,
|
height: int,
|
||||||
ttl_seconds: int,
|
|
||||||
file_size: int,
|
file_size: int,
|
||||||
date: int,
|
date: int,
|
||||||
thumbs: List[Thumbnail]
|
ttl_seconds: int = None,
|
||||||
|
thumbs: List[Thumbnail] = None
|
||||||
):
|
):
|
||||||
super().__init__(client)
|
super().__init__(client)
|
||||||
|
|
||||||
@ -74,9 +74,9 @@ class Photo(Object):
|
|||||||
self.file_ref = file_ref
|
self.file_ref = file_ref
|
||||||
self.width = width
|
self.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
self.ttl_seconds = ttl_seconds
|
|
||||||
self.file_size = file_size
|
self.file_size = file_size
|
||||||
self.date = date
|
self.date = date
|
||||||
|
self.ttl_seconds = ttl_seconds
|
||||||
self.thumbs = thumbs
|
self.thumbs = thumbs
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -96,9 +96,9 @@ class Photo(Object):
|
|||||||
file_ref=encode_file_ref(photo.file_reference),
|
file_ref=encode_file_ref(photo.file_reference),
|
||||||
width=big.w,
|
width=big.w,
|
||||||
height=big.h,
|
height=big.h,
|
||||||
ttl_seconds=ttl_seconds,
|
|
||||||
file_size=big.size,
|
file_size=big.size,
|
||||||
date=photo.date,
|
date=photo.date,
|
||||||
|
ttl_seconds=ttl_seconds,
|
||||||
thumbs=Thumbnail._parse(client, photo),
|
thumbs=Thumbnail._parse(client, photo),
|
||||||
client=client
|
client=client
|
||||||
)
|
)
|
||||||
|
@ -51,9 +51,6 @@ class Video(Object):
|
|||||||
mime_type (``str``, *optional*):
|
mime_type (``str``, *optional*):
|
||||||
Mime type of a file as defined by sender.
|
Mime type of a file as defined by sender.
|
||||||
|
|
||||||
ttl_seconds (``int``):
|
|
||||||
Time-to-live seconds, for secret photos.
|
|
||||||
|
|
||||||
supports_streaming (``bool``, *optional*):
|
supports_streaming (``bool``, *optional*):
|
||||||
True, if the video was uploaded with streaming support.
|
True, if the video was uploaded with streaming support.
|
||||||
|
|
||||||
@ -63,6 +60,9 @@ class Video(Object):
|
|||||||
date (``int``, *optional*):
|
date (``int``, *optional*):
|
||||||
Date the video was sent in Unix time.
|
Date the video was sent in Unix time.
|
||||||
|
|
||||||
|
ttl_seconds (``int``. *optional*):
|
||||||
|
Time-to-live seconds, for secret photos.
|
||||||
|
|
||||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||||
Video thumbnails.
|
Video thumbnails.
|
||||||
"""
|
"""
|
||||||
@ -78,10 +78,10 @@ class Video(Object):
|
|||||||
duration: int,
|
duration: int,
|
||||||
file_name: str = None,
|
file_name: str = None,
|
||||||
mime_type: str = None,
|
mime_type: str = None,
|
||||||
ttl_seconds: int = None,
|
|
||||||
supports_streaming: bool = None,
|
supports_streaming: bool = None,
|
||||||
file_size: int = None,
|
file_size: int = None,
|
||||||
date: int = None,
|
date: int = None,
|
||||||
|
ttl_seconds: int = None,
|
||||||
thumbs: List[Thumbnail] = None
|
thumbs: List[Thumbnail] = None
|
||||||
):
|
):
|
||||||
super().__init__(client)
|
super().__init__(client)
|
||||||
@ -93,10 +93,10 @@ class Video(Object):
|
|||||||
self.duration = duration
|
self.duration = duration
|
||||||
self.file_name = file_name
|
self.file_name = file_name
|
||||||
self.mime_type = mime_type
|
self.mime_type = mime_type
|
||||||
self.ttl_seconds = ttl_seconds
|
|
||||||
self.supports_streaming = supports_streaming
|
self.supports_streaming = supports_streaming
|
||||||
self.file_size = file_size
|
self.file_size = file_size
|
||||||
self.date = date
|
self.date = date
|
||||||
|
self.ttl_seconds = ttl_seconds
|
||||||
self.thumbs = thumbs
|
self.thumbs = thumbs
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -123,10 +123,10 @@ class Video(Object):
|
|||||||
duration=video_attributes.duration,
|
duration=video_attributes.duration,
|
||||||
file_name=file_name,
|
file_name=file_name,
|
||||||
mime_type=video.mime_type,
|
mime_type=video.mime_type,
|
||||||
ttl_seconds=ttl_seconds,
|
|
||||||
supports_streaming=video_attributes.supports_streaming,
|
supports_streaming=video_attributes.supports_streaming,
|
||||||
file_size=video.size,
|
file_size=video.size,
|
||||||
date=video.date,
|
date=video.date,
|
||||||
|
ttl_seconds=ttl_seconds,
|
||||||
thumbs=Thumbnail._parse(client, video),
|
thumbs=Thumbnail._parse(client, video),
|
||||||
client=client
|
client=client
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user