From 27a96a0df421861b36ae30e4e63284d8a9d3b389 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 8 Mar 2018 10:31:34 +0100 Subject: [PATCH] Fix progress going over 100% --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index bbf1263d..d97ae0d9 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -2104,7 +2104,7 @@ class Client: file_part += 1 if progress: - progress(file_part * part_size, file_size) + progress(min(file_part * part_size, file_size), file_size) except Exception as e: log.error(e) else: @@ -2202,7 +2202,7 @@ class Client: offset += limit if progress: - progress(offset, size) + progress(min(offset, size), size) r = session.send( functions.upload.GetFile(