summaryrefslogtreecommitdiff
path: root/cli/app/site/export.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app/site/export.py')
-rw-r--r--cli/app/site/export.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/app/site/export.py b/cli/app/site/export.py
index 4ce8b64..67b9538 100644
--- a/cli/app/site/export.py
+++ b/cli/app/site/export.py
@@ -101,6 +101,8 @@ def sanitize_graph(graph):
tile['href'] = page_path_lookup[tile['target_page_id']]
if 'url' in tile['settings'] and tile['settings']['url'].startswith('/static'):
tile['settings']['url'] = '/' + graph['path'] + tile['settings']['url']
+ if len(tile['settings'].get('appear_after', "")):
+ tile['settings']['appear_after'] = timestampToSeconds(tile['settings']['appear_after'])
sanitize_tile(tile)
page_path = page_path_lookup[page['id']]
page_lookup[page_path] = page
@@ -142,3 +144,11 @@ def sanitize_tile(data):
del data['page_id']
if 'target_page_id' in 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]