only count events with product
This commit is contained in:
parent
935ea07559
commit
49e045daf4
1 changed files with 2 additions and 1 deletions
|
@ -65,6 +65,7 @@ class Engine:
|
|||
# Count tags for the user
|
||||
count = defaultdict(lambda: 0)
|
||||
for event in user.get('events', []):
|
||||
if event.get('data', {}).get('product'):
|
||||
count[event['data']['product']] += 1
|
||||
# For each tag in playlist, increment score by count
|
||||
for playlist in playlists:
|
||||
|
|
Loading…
Reference in a new issue