don't reuse playlists

This commit is contained in:
j 2018-05-23 21:29:18 +02:00
parent 691679eb78
commit 8e06af0e2e

View file

@ -96,13 +96,13 @@ class Engine:
playlists = playlists[channels['userKeywords']:]
# For each playlist, compute global keyword score
score = {}
for playlist in self.playlists:
for playlist in playlists:
score[playlist['name']] = random.random()
for tag in [tag for tag in playlist['tags'] if tag in sliders]:
score[playlist['name']] += sliders[tag]
# Select highest scoring playlists
playlists = sorted(
self.playlists,
playlists,
key=lambda playlist: -score[playlist['name']]
)
videos += playlists[:channels['globalKeywords']]