revert changes
This commit is contained in:
parent
0a5247691f
commit
0a1325c98d
|
@ -37,24 +37,25 @@ def update_wiki(token_id, token_secret, update_csv, pages):
|
||||||
update_page_count = sum([update_films_by_year, update_films_by_country, update_film_references,
|
update_page_count = sum([update_films_by_year, update_films_by_country, update_film_references,
|
||||||
update_hidden_themes, update_keyword_scores])
|
update_hidden_themes, update_keyword_scores])
|
||||||
|
|
||||||
with IncrementalBar('Processing viewing data', max=update_page_count, suffix='%(percent).1f%% - %(eta)ds remaining', check_tty=False) as bar:
|
print("Processing viewing data")
|
||||||
|
|
||||||
if update_films_by_year:
|
if update_films_by_year:
|
||||||
films_by_year = FilmsByYear.get_films_by_year(viewings)
|
films_by_year = FilmsByYear.get_films_by_year(viewings)
|
||||||
bar.next()
|
FilmsByYear.update_page(token_id, token_secret, films_by_year)
|
||||||
if update_films_by_country:
|
if update_films_by_country:
|
||||||
films_by_country = FilmsByCountry.get_films_by_country(viewings)
|
films_by_country = FilmsByCountry.get_films_by_country(viewings)
|
||||||
bar.next()
|
FilmsByCountry.update_page(token_id, token_secret, films_by_country)
|
||||||
if update_film_references:
|
if update_film_references:
|
||||||
films_by_reference = FilmsByReference.get_films_by_reference(viewings)
|
films_by_reference = FilmsByReference.get_films_by_reference(viewings)
|
||||||
bar.next()
|
FilmsByReference.update_page(token_id, token_secret, films_by_reference)
|
||||||
if update_hidden_themes:
|
if update_hidden_themes:
|
||||||
hidden_themes = HiddenThemes.get_hidden_themes(viewings, token_id, token_secret)
|
hidden_themes = HiddenThemes.get_hidden_themes(viewings, token_id, token_secret)
|
||||||
bar.next()
|
HiddenThemes.update_page(token_id, token_secret, hidden_themes)
|
||||||
if update_keyword_scores:
|
if update_keyword_scores:
|
||||||
keyword_scores = KeywordScores.get_keyword_scores(viewings)
|
keyword_scores = KeywordScores.get_keyword_scores(viewings)
|
||||||
bar.next()
|
KeywordScores.update_page(token_id, token_secret, keyword_scores)
|
||||||
|
|
||||||
bar.finish()
|
print("Done!")
|
||||||
|
|
||||||
with IncrementalBar('Updating pages', max=update_page_count, check_tty=False) as bar:
|
with IncrementalBar('Updating pages', max=update_page_count, check_tty=False) as bar:
|
||||||
if update_films_by_year:
|
if update_films_by_year:
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
from collections import Counter, OrderedDict
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
from vcinema_utils import VCinemaUtils
|
|
||||||
|
|
||||||
warnings.filterwarnings("ignore")
|
|
||||||
|
|
||||||
|
|
||||||
def get_actor_scores(viewings):
|
|
||||||
for viewing_ind in range(len(viewings)):
|
|
||||||
viewing = viewings[viewing_ind]
|
|
||||||
|
|
||||||
cast_list = []
|
|
||||||
|
|
||||||
for cast_member in viewing['cast']:
|
|
||||||
cast_member_name = (cast_member['name'], cast_member.currentRole)
|
|
||||||
cast_list.append(cast_member_name)
|
|
||||||
|
|
||||||
viewings[viewing_ind]['cast'] = cast_list
|
|
||||||
|
|
||||||
viewings_filtered_by_cast_member = VCinemaUtils.filter_viewings(viewings, "cast")
|
|
||||||
|
|
||||||
viewings_filtered_by_cast_member = OrderedDict(sorted(viewings_filtered_by_cast_member.items(), key=lambda t: len(t[1]), reverse=True))
|
|
||||||
|
|
||||||
return viewings_filtered_by_cast_member
|
|
||||||
|
|
Loading…
Reference in New Issue