mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 12:57:52 +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``):
|
||||
Photo height.
|
||||
|
||||
ttl_seconds (``int``):
|
||||
Time-to-live seconds, for secret photos.
|
||||
|
||||
file_size (``int``):
|
||||
File size.
|
||||
|
||||
date (``int``):
|
||||
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*):
|
||||
Available thumbnails of this photo.
|
||||
"""
|
||||
@ -63,10 +63,10 @@ class Photo(Object):
|
||||
file_ref: str,
|
||||
width: int,
|
||||
height: int,
|
||||
ttl_seconds: int,
|
||||
file_size: int,
|
||||
date: int,
|
||||
thumbs: List[Thumbnail]
|
||||
ttl_seconds: int = None,
|
||||
thumbs: List[Thumbnail] = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -74,9 +74,9 @@ class Photo(Object):
|
||||
self.file_ref = file_ref
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.ttl_seconds = ttl_seconds
|
||||
self.file_size = file_size
|
||||
self.date = date
|
||||
self.ttl_seconds = ttl_seconds
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
@ -96,9 +96,9 @@ class Photo(Object):
|
||||
file_ref=encode_file_ref(photo.file_reference),
|
||||
width=big.w,
|
||||
height=big.h,
|
||||
ttl_seconds=ttl_seconds,
|
||||
file_size=big.size,
|
||||
date=photo.date,
|
||||
ttl_seconds=ttl_seconds,
|
||||
thumbs=Thumbnail._parse(client, photo),
|
||||
client=client
|
||||
)
|
||||
|
@ -51,9 +51,6 @@ class Video(Object):
|
||||
mime_type (``str``, *optional*):
|
||||
Mime type of a file as defined by sender.
|
||||
|
||||
ttl_seconds (``int``):
|
||||
Time-to-live seconds, for secret photos.
|
||||
|
||||
supports_streaming (``bool``, *optional*):
|
||||
True, if the video was uploaded with streaming support.
|
||||
|
||||
@ -63,6 +60,9 @@ class Video(Object):
|
||||
date (``int``, *optional*):
|
||||
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*):
|
||||
Video thumbnails.
|
||||
"""
|
||||
@ -78,10 +78,10 @@ class Video(Object):
|
||||
duration: int,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
ttl_seconds: int = None,
|
||||
supports_streaming: bool = None,
|
||||
file_size: int = None,
|
||||
date: int = None,
|
||||
ttl_seconds: int = None,
|
||||
thumbs: List[Thumbnail] = None
|
||||
):
|
||||
super().__init__(client)
|
||||
@ -93,10 +93,10 @@ class Video(Object):
|
||||
self.duration = duration
|
||||
self.file_name = file_name
|
||||
self.mime_type = mime_type
|
||||
self.ttl_seconds = ttl_seconds
|
||||
self.supports_streaming = supports_streaming
|
||||
self.file_size = file_size
|
||||
self.date = date
|
||||
self.ttl_seconds = ttl_seconds
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
@ -123,10 +123,10 @@ class Video(Object):
|
||||
duration=video_attributes.duration,
|
||||
file_name=file_name,
|
||||
mime_type=video.mime_type,
|
||||
ttl_seconds=ttl_seconds,
|
||||
supports_streaming=video_attributes.supports_streaming,
|
||||
file_size=video.size,
|
||||
date=video.date,
|
||||
ttl_seconds=ttl_seconds,
|
||||
thumbs=Thumbnail._parse(client, video),
|
||||
client=client
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user