Actually set the photo_type from the given file_id if we have that information.

This commit is contained in:
luckydonald 2020-11-08 12:59:18 +01:00
parent 5ae66d7d40
commit bb9d1f895f

View File

@ -1158,6 +1158,9 @@ def resolve_bot_file_id(file_id):
file: PhotoFileId
photo_type = 's' if file.id or file.access_hash else 'x'
if isinstance(file.photosize, PhotoFileId.PhotosizeSourceThumbnail) and file.photosize.thumbnail_type:
photo_type = file.photosize.thumbnail_type.encode()
# end if
foto_size = file.photosize
if isinstance(foto_size, (PhotoFileId.PhotosizeSourceLegacy, PhotoFileId.PhotosizeSourceThumbnail, PhotoFileId.PhotosizeSourceDialogPhotoSmall, PhotoFileId.PhotosizeSourceDialogPhotoBig, PhotoFileId.PhotosizeSourceStickersetThumbnail)):