Cast time formats to int
Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
parent
c9ede8bf16
commit
7228461ab9
|
|
@ -95,15 +95,18 @@ def get_readable_message(progress_list: list = None):
|
||||||
def get_readable_time(seconds: int) -> str:
|
def get_readable_time(seconds: int) -> str:
|
||||||
result = ''
|
result = ''
|
||||||
(days, remainder) = divmod(seconds, 86400)
|
(days, remainder) = divmod(seconds, 86400)
|
||||||
|
days = int(days)
|
||||||
if days != 0:
|
if days != 0:
|
||||||
result += f'{days}d'
|
result += f'{days}d'
|
||||||
(hours, remainder) = divmod(remainder, 3600)
|
(hours, remainder) = divmod(remainder, 3600)
|
||||||
|
hours = int(hours)
|
||||||
if hours != 0:
|
if hours != 0:
|
||||||
result += f'{hours}h'
|
result += f'{hours}h'
|
||||||
(minutes, seconds) = divmod(remainder, 60)
|
(minutes, seconds) = divmod(remainder, 60)
|
||||||
|
minutes = int(minutes)
|
||||||
if minutes != 0:
|
if minutes != 0:
|
||||||
result += f'{minutes}m'
|
result += f'{minutes}m'
|
||||||
|
seconds = int(seconds)
|
||||||
result += f'{seconds}s'
|
result += f'{seconds}s'
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue