From 87a44997d7a9f7527feed183ab8c306d77d8fe12 Mon Sep 17 00:00:00 2001 From: Sarah Date: Fri, 1 Jul 2022 15:26:16 +0100 Subject: [PATCH] fix display --- wiki_pages/HiddenThemes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wiki_pages/HiddenThemes.py b/wiki_pages/HiddenThemes.py index a21c517..23d6ddc 100644 --- a/wiki_pages/HiddenThemes.py +++ b/wiki_pages/HiddenThemes.py @@ -69,8 +69,15 @@ def build_page(hidden_themes): row_data.append(str(date)) row_data.append(VCinemaUtils.get_film_list(data['viewings'])) if 'hidden_themes' in data and data['hidden_themes'] != {}: - row_data.append(("
".join( - "{} ({}%)".format(k, data['hidden_themes'][k] * 100) for k in sorted(data['hidden_themes'])))) + hidden_theme_labels = [] + + for hidden_theme in sorted(data['hidden_themes'].keys()): + if data['hidden_themes'][hidden_theme] == 1: + hidden_theme_labels.append(hidden_theme) + else: + hidden_theme_labels.append("{} ({}%)".format(hidden_theme, round(data['hidden_themes'][hidden_theme] * 100))) + + row_data.append("
".join(hidden_theme_labels)) else: row_data.append("N/A")