use events not activities
This commit is contained in:
parent
d856138e3a
commit
3841a67a79
1 changed files with 2 additions and 6 deletions
|
@ -50,12 +50,8 @@ class Engine:
|
||||||
playlists = playlists[channels['keywords']:]
|
playlists = playlists[channels['keywords']:]
|
||||||
# Count tags for the user
|
# Count tags for the user
|
||||||
count = defaultdict(lambda: 0)
|
count = defaultdict(lambda: 0)
|
||||||
for activity in user.get('activities', []):
|
for event in user.get('events', []):
|
||||||
if activity.get('type') == 'SCREENING_CHECK_IN':
|
count[event['data']['product']] += 1
|
||||||
product = activity.get('extras', {}).get('event', {}).get('alias')
|
|
||||||
if product:
|
|
||||||
product = product.replace('_', ' ')
|
|
||||||
count[product] += 1
|
|
||||||
# For each tag in playlist, increment score by count
|
# For each tag in playlist, increment score by count
|
||||||
for playlist in playlists:
|
for playlist in playlists:
|
||||||
score[playlist['name']] = random.random()
|
score[playlist['name']] = random.random()
|
||||||
|
|
Loading…
Reference in a new issue