From 3d95161942ef53094ca82b139daeddf808a32af7 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 25 Jan 2018 21:54:38 +0100 Subject: [PATCH] use nodename as name --- recommendation_engine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recommendation_engine.py b/recommendation_engine.py index 662edd6..19cbb5d 100644 --- a/recommendation_engine.py +++ b/recommendation_engine.py @@ -72,14 +72,16 @@ class Engine: def update(self): # Get all storylines with tags storylines = [{ + 'id': entity['id'], 'name': entity['name'], + 'nodename': entity['nodename'], 'tags': entity['tags'] } for entity in self.pandora.find_entities({ 'conditions': [ {'key': 'type', 'operator': '==', 'value': 'storylines'}, ], 'operator': '&' - }, ['id', 'name', 'tags']) if entity.get('tags', [])] + }, ['id', 'name', 'tags', 'nodename']) if entity.get('tags', [])] # Get list of storyline names names = list(set([storyline['name'] for storyline in storylines])) # Get all clips annotated with storyline references @@ -114,7 +116,8 @@ class Engine: ) # Get and cache playlists self.playlists = [playlist for playlist in [{ - 'name': storyline['name'], + 'id': storyline['id'], + 'name': storyline['nodename'], 'tags': storyline['tags'], 'clips': [{ 'id': clip['id'],