diff options
Diffstat (limited to 'helpers/__init__.py')
-rw-r--r-- | helpers/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helpers/__init__.py b/helpers/__init__.py index 70667fd..0f819e7 100644 --- a/helpers/__init__.py +++ b/helpers/__init__.py | |||
@@ -9,3 +9,10 @@ def path(): | |||
9 | path = os.path.dirname(os.path.realpath(__file__)) | 9 | path = os.path.dirname(os.path.realpath(__file__)) |
10 | return path + "/../" | 10 | return path + "/../" |
11 | 11 | ||
12 | def duration_to_min_sec(duration): | ||
13 | minutes = int(duration / 60) | ||
14 | seconds = int(duration) % 60 | ||
15 | if minutes < 100: | ||
16 | return "{:2}:{:0>2}".format(minutes, seconds) | ||
17 | else: | ||
18 | return "{}:{:0>2}".format(minutes, seconds) | ||