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,