fix hidden themes page

This commit is contained in:
Sarah 2022-12-10 16:46:22 +00:00
parent 79a0c255cf
commit 70d4f84679

View File

@ -64,11 +64,8 @@ def build_page(hidden_themes):
table = MarkdownUtils.MarkdownTable(["Date", "Films", "Hidden Themes"])
for date, data in hidden_themes.items():
table += "\n"
films = VCinemaUtils.get_film_list(data['viewings'])
row_data = []
row_data.append(str(date))
row_data.append(VCinemaUtils.get_film_list(data['viewings']))
if 'hidden_themes' in data and data['hidden_themes'] != {}:
hidden_theme_labels = []
@ -78,10 +75,11 @@ def build_page(hidden_themes):
else:
hidden_theme_labels.append("<i>{} ({}%)</i>".format(hidden_theme, round(data['hidden_themes'][hidden_theme] * 100)))
row_data.append("<br>".join(hidden_theme_labels))
hidden_themes = "<br>".join(hidden_theme_labels)
else:
row_data.append("N/A")
hidden_themes = "N/A"
row_data = [date, films, hidden_themes]
table.add_row(row_data)
return table
return str(table)