shuffle recommendations, for more variety
This commit is contained in:
parent
646b62a149
commit
4ac68a6db6
3
tmdb.py
3
tmdb.py
@ -73,7 +73,8 @@ class Tmdb:
|
||||
# get a number of trailers of a certain kind for a list of recommended movies
|
||||
def get_trailers(self, recommendations, cliptype, count):
|
||||
results = []
|
||||
# loop over list of recommendations
|
||||
# loop over ten out of the list of recommendations
|
||||
random.shuffle(recommendations)
|
||||
for recommendation in recommendations[:10]:
|
||||
all_trailers = self.get_movie_trailers(recommendation['movieid'])
|
||||
# filter to get only a certain kind of trailer
|
||||
|
Loading…
Reference in New Issue
Block a user