change hidden theme calculation
This commit is contained in:
parent
14c3e2a76c
commit
935f1e25ca
@ -5,8 +5,7 @@ from progress.bar import IncrementalBar
|
||||
|
||||
|
||||
def get_hidden_themes(imdb_ids):
|
||||
hidden_themes = set()
|
||||
is_first = True
|
||||
film_keywords = []
|
||||
|
||||
with IncrementalBar('Retrieving movie data', max=len(imdb_ids), suffix='%(percent).1f%% - %(eta)ds remaining', check_tty=False) as bar:
|
||||
for imdb_id in imdb_ids:
|
||||
@ -14,14 +13,12 @@ def get_hidden_themes(imdb_ids):
|
||||
|
||||
if 'keywords' in movie_data:
|
||||
keywords = set(movie_data['keywords'])
|
||||
if is_first:
|
||||
hidden_themes = keywords
|
||||
is_first = False
|
||||
else:
|
||||
hidden_themes = hidden_themes.intersection(keywords)
|
||||
film_keywords.append(keywords)
|
||||
|
||||
bar.next()
|
||||
|
||||
hidden_themes = set.intersection(*film_keywords)
|
||||
|
||||
return hidden_themes
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user