mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Fix progress going over 100%
This commit is contained in:
parent
b5c7cf781a
commit
27a96a0df4
@ -2104,7 +2104,7 @@ class Client:
|
|||||||
file_part += 1
|
file_part += 1
|
||||||
|
|
||||||
if progress:
|
if progress:
|
||||||
progress(file_part * part_size, file_size)
|
progress(min(file_part * part_size, file_size), file_size)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e)
|
log.error(e)
|
||||||
else:
|
else:
|
||||||
@ -2202,7 +2202,7 @@ class Client:
|
|||||||
offset += limit
|
offset += limit
|
||||||
|
|
||||||
if progress:
|
if progress:
|
||||||
progress(offset, size)
|
progress(min(offset, size), size)
|
||||||
|
|
||||||
r = session.send(
|
r = session.send(
|
||||||
functions.upload.GetFile(
|
functions.upload.GetFile(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user