summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/app/site/export.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/cli/app/site/export.py b/cli/app/site/export.py
index 2b8b366..89db305 100644
--- a/cli/app/site/export.py
+++ b/cli/app/site/export.py
@@ -148,9 +148,12 @@ def sanitize_tile(data):
del data['target_page_id']
def timestampToSeconds(time_str):
- time_str_parts = list(map(float, time_str.strip().split(":")))
- if len(time_str_parts) == 3:
- return (time_str_parts[0] * 60 + time_str_parts[1]) * 60 + time_str_parts[2]
- if len(time_str_parts) == 2:
- return time_str_parts[0] * 60 + time_str_parts[1]
- return time_str_parts[0]
+ try:
+ time_str_parts = list(map(float, time_str.strip().split(":")))
+ if len(time_str_parts) == 3:
+ return (time_str_parts[0] * 60 + time_str_parts[1]) * 60 + time_str_parts[2]
+ if len(time_str_parts) == 2:
+ return time_str_parts[0] * 60 + time_str_parts[1]
+ return time_str_parts[0]
+ except:
+ return 0