From 935ea0755974c3da1e283301de92264686a1795b Mon Sep 17 00:00:00 2001 From: j Date: Sat, 27 Jan 2018 19:40:02 +0100 Subject: [PATCH] disable _patch_clips --- recommendation_engine.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recommendation_engine.py b/recommendation_engine.py index 90ab662..c2d921a 100644 --- a/recommendation_engine.py +++ b/recommendation_engine.py @@ -127,18 +127,19 @@ class Engine: # Sort clips clips = sorted( clips, - key=lambda clip: order[clip['id'].split('/')[0]] * 1000000 + clip['in'] + key=lambda clip: (order[clip['id'].split('/')[0]], clip['in']) ) # Get and cache playlists self.playlists = [playlist for playlist in [{ 'id': storyline['id'], 'name': storyline['nodename'], 'tags': storyline['tags'], - 'clips': self._patch_clips([{ + 'clips': [{ + 'item': clip['id'].split('/')[0], 'id': clip['id'], 'in': clip['in'], 'out': clip['out'] - } for clip in clips if clip['value'] == storyline['name']]) + } for clip in clips if clip['value'] == storyline['name']] } for storyline in storylines] if playlist['clips']] with open(os.path.join(self.path, 'playlists.json'), 'w') as f: f.write(json.dumps(self.playlists, indent=4, sort_keys=True))