diff --git a/video-feed.py b/video-feed.py index 70f289e..7d7fbf2 100644 --- a/video-feed.py +++ b/video-feed.py @@ -88,9 +88,10 @@ def update_post(post_directory, video_metadata): if os.path.exists(post_directory): if os.path.exists(os.path.join(post_directory,'.timestamp')): old_timestamp = open(os.path.join(post_directory,'.timestamp')).read() - current_timestamp = arrow.get(video_metadata['updated_at']) - current_timestamp = arrow.get(current_timestamp.format('X')) + #FIXME: this is ugly but I need to do this because arrow removes miliseconds + current_timestamp = arrow.get(video_metadata['updated_at']) + current_timestamp = arrow.get(current_timestamp.format('X')) if current_timestamp > arrow.get(old_timestamp): print('Updating', video_metadata['name'], '({})'.format(video_metadata['uuid'])) @@ -98,6 +99,7 @@ def update_post(post_directory, video_metadata): else: print('Video current: ', video_metadata['name'], '({})'.format(video_metadata['uuid'])) else: + #compat for when there is no timestamp yet.. create_post(post_dir, video_metadata)