Merge pull request #217 from vn-ki/master

Beautify videotime_from_seconds func
This commit is contained in:
Linus Groh
2018-01-22 23:47:20 +01:00
committed by GitHub

View File

@@ -101,11 +101,11 @@ def filter_path(path):
def videotime_from_seconds(time): def videotime_from_seconds(time):
if time<60: if time < 60:
return str(time) return str(time)
if time<3600: if time < 3600:
return '{}:{}'.format(str(time//60), str(time%60).zfill(2)) return '{0}:{1:02}'.format(time//60, time % 60)
return '{}:{}:{}'.format(str(time//60), return '{0}:{1:02}:{2:02}'.format((time//60)//60,
str((time%60)//60).zfill(2), (time//60) % 60,
str((time%60)%60).zfill(2)) time % 60)