2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Report offset instead of 0 in case file size is missing (for file_id)

This commit is contained in:
Dan 2018-12-15 08:51:20 +01:00
parent 9c91720104
commit 4ba5e63034

View File

@ -1296,7 +1296,7 @@ class Client(Methods, BaseClient):
offset += limit
if progress:
progress(self, min(offset, size), size, *progress_args)
progress(self, min(offset, size) if size != 0 else offset, size, *progress_args)
r = session.send(
functions.upload.GetFile(
@ -1378,7 +1378,7 @@ class Client(Methods, BaseClient):
offset += limit
if progress:
progress(self, min(offset, size), size, *progress_args)
progress(self, min(offset, size) if size != 0 else offset, size, *progress_args)
if len(chunk) < limit:
break