parallel transfer: disable async_upload

This commit is contained in:
Sumner Evans
2022-03-25 15:12:35 -06:00
parent 601058d61c
commit 8d7cfd8e46
2 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -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):
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
file = None
@@ -317,7 +317,6 @@ async def parallel_transfer_to_matrix(
filename: str,
encrypt: bool,
parallel_id: int,
async_upload: bool = False,
) -> DBTelegramFile:
size = location.size
mime_type = location.mime_type
@@ -341,11 +340,7 @@ async def parallel_transfer_to_matrix(
data = encrypted(data)
up_mime_type = "application/octet-stream"
content_uri = await intent.upload_media(
data,
mime_type=up_mime_type,
filename=filename,
size=size if not encrypt else None,
async_upload=async_upload and not encrypt,
data, mime_type=up_mime_type, filename=filename, size=size if not encrypt else None
)
if decryption_info:
decryption_info.url = content_uri