From a0f3f411c310742b442c69e59e620cd42522a44e Mon Sep 17 00:00:00 2001 From: j Date: Sat, 21 Apr 2018 17:28:08 +0100 Subject: [PATCH] cast order to int --- recommendation_engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recommendation_engine.py b/recommendation_engine.py index 17b9372..023bbe4 100644 --- a/recommendation_engine.py +++ b/recommendation_engine.py @@ -180,11 +180,11 @@ class Engine: videos = sorted(videos_ + [ self.pandora.get(id, ['code', 'id', 'order', 'title']) for id in ids if not id in ids_ - ], key=lambda video: video['order']) + ], key=lambda video: int(video['order'])) with open(filename, 'w') as f: f.write(json.dumps(videos, indent=4, sort_keys=True)) # Get video order - order = {video['id']: video['order'] for video in videos} + order = {video['id']: int(video['order']) for video in videos} # Sort clips clips = sorted( clips,