parallel transfer: disable async_upload
This commit is contained in:
@@ -273,7 +273,7 @@ async def _unlocked_transfer_file_to_matrix(
|
|||||||
|
|
||||||
if parallel_id and isinstance(location, Document) and (not is_sticker or not tgs_convert):
|
if parallel_id and isinstance(location, Document) and (not is_sticker or not tgs_convert):
|
||||||
db_file = await parallel_transfer_to_matrix(
|
db_file = await parallel_transfer_to_matrix(
|
||||||
client, intent, loc_id, location, filename, encrypt, parallel_id, async_upload
|
client, intent, loc_id, location, filename, encrypt, parallel_id
|
||||||
)
|
)
|
||||||
mime_type = location.mime_type
|
mime_type = location.mime_type
|
||||||
file = None
|
file = None
|
||||||
|
|||||||
@@ -317,7 +317,6 @@ async def parallel_transfer_to_matrix(
|
|||||||
filename: str,
|
filename: str,
|
||||||
encrypt: bool,
|
encrypt: bool,
|
||||||
parallel_id: int,
|
parallel_id: int,
|
||||||
async_upload: bool = False,
|
|
||||||
) -> DBTelegramFile:
|
) -> DBTelegramFile:
|
||||||
size = location.size
|
size = location.size
|
||||||
mime_type = location.mime_type
|
mime_type = location.mime_type
|
||||||
@@ -341,11 +340,7 @@ async def parallel_transfer_to_matrix(
|
|||||||
data = encrypted(data)
|
data = encrypted(data)
|
||||||
up_mime_type = "application/octet-stream"
|
up_mime_type = "application/octet-stream"
|
||||||
content_uri = await intent.upload_media(
|
content_uri = await intent.upload_media(
|
||||||
data,
|
data, mime_type=up_mime_type, filename=filename, size=size if not encrypt else None
|
||||||
mime_type=up_mime_type,
|
|
||||||
filename=filename,
|
|
||||||
size=size if not encrypt else None,
|
|
||||||
async_upload=async_upload and not encrypt,
|
|
||||||
)
|
)
|
||||||
if decryption_info:
|
if decryption_info:
|
||||||
decryption_info.url = content_uri
|
decryption_info.url = content_uri
|
||||||
|
|||||||
Reference in New Issue
Block a user