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
|
# get a number of trailers of a certain kind for a list of recommended movies
|
||||||
def get_trailers(self, recommendations, cliptype, count):
|
def get_trailers(self, recommendations, cliptype, count):
|
||||||
results = []
|
results = []
|
||||||
# loop over list of recommendations
|
# loop over ten out of the list of recommendations
|
||||||
|
random.shuffle(recommendations)
|
||||||
for recommendation in recommendations[:10]:
|
for recommendation in recommendations[:10]:
|
||||||
all_trailers = self.get_movie_trailers(recommendation['movieid'])
|
all_trailers = self.get_movie_trailers(recommendation['movieid'])
|
||||||
# filter to get only a certain kind of trailer
|
# filter to get only a certain kind of trailer
|
||||||
|
Loading…
Reference in New Issue
Block a user