Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
fixes env var BAR_SIZE detected as string
Browse files Browse the repository at this point in the history
  • Loading branch information
azamaulanaaa committed Sep 30, 2020
1 parent 4b76bd4 commit 215531d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bot/handlers/leech_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ async def progress_dl(message : Message, aria2_api : aria2.aria2, gid : int, pre
if not download.is_complete:
if not download.error_message:
block = ""
for i in range(1, CONFIG.BAR_SIZE + 1):
if i <= floor(download.progress * CONFIG.BAR_SIZE/100):
for i in range(1, int(CONFIG.BAR_SIZE) + 1):
if i <= floor(download.progress * int(CONFIG.BAR_SIZE)/100):
block += LOCAL.BLOCK_FILLED
else:
block += LOCAL.BLOCK_EMPTY
Expand Down
4 changes: 2 additions & 2 deletions bot/handlers/upload_to_tg_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ async def upload_fn(chat_id, file, **kwargs):
async def progress_upload_tg(current, total, message, info):
percentage = round(current * 10000 / total) / 100
block = ""
for i in range(1, CONFIG.BAR_SIZE + 1):
if i <= floor(percentage * CONFIG.BAR_SIZE/100):
for i in range(1, int(CONFIG.BAR_SIZE) + 1):
if i <= floor(percentage * int(CONFIG.BAR_SIZE)/100):
block += LOCAL.BLOCK_FILLED
else:
block += LOCAL.BLOCK_EMPTY
Expand Down

0 comments on commit 215531d

Please sign in to comment.