From d6f8ff78e1edf278c148e6d711fdf63856934a7e Mon Sep 17 00:00:00 2001 From: bl3kunja Date: Sun, 8 Feb 2026 19:57:30 +0100 Subject: [PATCH] no tournament started --- .../league_20260208_195711.json | 460 ++++++ data/league_state.json | 457 ------ data/tournament_results.json | 1242 ----------------- templates/league_scoreboard_display.html | 24 +- templates/results_display.html | 12 +- tv_app.py | 43 +- 6 files changed, 509 insertions(+), 1729 deletions(-) create mode 100644 data/league_archives/league_20260208_195711.json delete mode 100644 data/league_state.json delete mode 100644 data/tournament_results.json diff --git a/data/league_archives/league_20260208_195711.json b/data/league_archives/league_20260208_195711.json new file mode 100644 index 0000000..40d06b4 --- /dev/null +++ b/data/league_archives/league_20260208_195711.json @@ -0,0 +1,460 @@ +{ + "league": { + "league_id": "league_20251115_094741", + "created_at": "2025-11-15T09:47:41.711914", + "tournament_type": "20_targets", + "total_tournaments": 5, + "current_tournament": 3, + "participants": { + "1": { + "name": "Domen Pleterski", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 320, + "tens_count": 3, + "participated": true + }, + { + "tournament": 2, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + }, + { + "tournament": 3, + "score": 320, + "tens_count": 2, + "participated": true + } + ], + "total_score": 640, + "final_score": 0, + "tournaments_participated": 0 + }, + "5": { + "name": "Jože Verhnjak", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 295, + "tens_count": 2, + "participated": true + }, + { + "tournament": 2, + "score": 293, + "tens_count": 3, + "participated": true + }, + { + "tournament": 3, + "score": 293, + "tens_count": 2, + "participated": true + } + ], + "total_score": 881, + "final_score": 0, + "tournaments_participated": 0 + }, + "7": { + "name": "Branko Pokeržnik", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 316, + "tens_count": 1, + "participated": true + }, + { + "tournament": 2, + "score": 332, + "tens_count": 3, + "participated": true + }, + { + "tournament": 3, + "score": 318, + "tens_count": 1, + "participated": true + } + ], + "total_score": 966, + "final_score": 0, + "tournaments_participated": 0 + }, + "9": { + "name": "Janez Božič", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 264, + "tens_count": 2, + "participated": true + }, + { + "tournament": 2, + "score": 276, + "tens_count": 0, + "participated": true + }, + { + "tournament": 3, + "score": 261, + "tens_count": 1, + "participated": true + } + ], + "total_score": 801, + "final_score": 0, + "tournaments_participated": 0 + }, + "10": { + "name": "Mitja Čeh", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 329, + "tens_count": 1, + "participated": true + }, + { + "tournament": 2, + "score": 312, + "tens_count": 4, + "participated": true + }, + { + "tournament": 3, + "score": 307, + "tens_count": 2, + "participated": true + } + ], + "total_score": 948, + "final_score": 0, + "tournaments_participated": 0 + }, + "11": { + "name": "Rado Kefer", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 275, + "tens_count": 0, + "participated": true + }, + { + "tournament": 2, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + }, + { + "tournament": 3, + "score": 314, + "tens_count": 3, + "participated": true + } + ], + "total_score": 589, + "final_score": 0, + "tournaments_participated": 0 + }, + "14": { + "name": "Karli Proje", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + }, + { + "tournament": 2, + "score": 0, + "tens_count": 0, + "participated": true + }, + { + "tournament": 3, + "score": 0, + "tens_count": 0, + "participated": true + } + ], + "total_score": 0, + "final_score": 0, + "tournaments_participated": 0 + }, + "15": { + "name": "Jan Pleterski", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 269, + "tens_count": 1, + "participated": true + }, + { + "tournament": 2, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + }, + { + "tournament": 3, + "score": 267, + "tens_count": 1, + "participated": true + } + ], + "total_score": 536, + "final_score": 0, + "tournaments_participated": 0 + }, + "16": { + "name": "Silvo Poročnik", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 293, + "tens_count": 3, + "participated": true + }, + { + "tournament": 2, + "score": 278, + "tens_count": 3, + "participated": true + }, + { + "tournament": 3, + "score": 282, + "tens_count": 3, + "participated": true + } + ], + "total_score": 853, + "final_score": 0, + "tournaments_participated": 0 + }, + "17": { + "name": "Dušan Onuk", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 313, + "tens_count": 4, + "participated": true + }, + { + "tournament": 2, + "score": 325, + "tens_count": 2, + "participated": true + }, + { + "tournament": 3, + "score": 192, + "tens_count": 3, + "participated": true + } + ], + "total_score": 830, + "final_score": 0, + "tournaments_participated": 0 + }, + "18": { + "name": "Matjaž Pleterski", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 280, + "tens_count": 2, + "participated": true + }, + { + "tournament": 2, + "score": 276, + "tens_count": 4, + "participated": true + }, + { + "tournament": 3, + "score": 307, + "tens_count": 0, + "participated": true + } + ], + "total_score": 863, + "final_score": 0, + "tournaments_participated": 0 + }, + "22": { + "name": "Doris Fesel", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + }, + { + "tournament": 2, + "score": 0, + "tens_count": 0, + "participated": true + }, + { + "tournament": 3, + "score": 0, + "tens_count": 0, + "participated": true + } + ], + "total_score": 0, + "final_score": 0, + "tournaments_participated": 0 + }, + "24": { + "name": "Jože Verdinek", + "joker_used": false, + "tournament_results": [ + { + "tournament": 1, + "score": 311, + "tens_count": 5, + "participated": true + }, + { + "tournament": 2, + "score": 315, + "tens_count": 5, + "participated": true + }, + { + "tournament": 3, + "score": 312, + "tens_count": 2, + "participated": true + } + ], + "total_score": 938, + "final_score": 0, + "tournaments_participated": 0 + }, + "50": { + "name": "Vid Ravnjak", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 302, + "tens_count": 6, + "participated": true + }, + { + "tournament": 2, + "score": 309, + "tens_count": 4, + "participated": true + }, + { + "tournament": 3, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + } + ], + "total_score": 611, + "final_score": 0, + "tournaments_participated": 0 + }, + "51": { + "name": "Robi Ovčar", + "joker_used": true, + "tournament_results": [ + { + "tournament": 1, + "score": 269, + "tens_count": 1, + "participated": true + }, + { + "tournament": 2, + "score": 0, + "tens_count": 0, + "participated": false, + "joker": true + }, + { + "tournament": 3, + "score": 265, + "tens_count": 1, + "participated": true + } + ], + "total_score": 534, + "final_score": 0, + "tournaments_participated": 0 + } + }, + "completed_tournaments": [ + { + "tournament_number": 1, + "tournament_type": "20_targets", + "finished_at": "2025-11-15T11:50:43.358782", + "results_summary": { + "participants": 15, + "shots_per_participant": 40, + "total_shots": 600, + "format_description": "20 Targets (2 shots each)" + } + }, + { + "tournament_number": 2, + "tournament_type": "20_targets", + "finished_at": "2025-12-13T12:13:29.550924", + "results_summary": { + "participants": 12, + "shots_per_participant": 40, + "total_shots": 480, + "format_description": "20 Targets (2 shots each)" + } + }, + { + "tournament_number": 3, + "tournament_type": "20_targets", + "finished_at": "2026-01-10T11:34:15.800129", + "results_summary": { + "participants": 14, + "shots_per_participant": 40, + "total_shots": 560, + "format_description": "20 Targets (2 shots each)" + } + } + ], + "league_finished": false + }, + "archived_at": "2026-02-08T19:57:11.791065" +} \ No newline at end of file diff --git a/data/league_state.json b/data/league_state.json deleted file mode 100644 index 61ca278..0000000 --- a/data/league_state.json +++ /dev/null @@ -1,457 +0,0 @@ -{ - "league_id": "league_20251115_094741", - "created_at": "2025-11-15T09:47:41.711914", - "tournament_type": "20_targets", - "total_tournaments": 5, - "current_tournament": 3, - "participants": { - "1": { - "name": "Domen Pleterski", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 320, - "tens_count": 3, - "participated": true - }, - { - "tournament": 2, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - }, - { - "tournament": 3, - "score": 320, - "tens_count": 2, - "participated": true - } - ], - "total_score": 640, - "final_score": 0, - "tournaments_participated": 0 - }, - "5": { - "name": "Jože Verhnjak", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 295, - "tens_count": 2, - "participated": true - }, - { - "tournament": 2, - "score": 293, - "tens_count": 3, - "participated": true - }, - { - "tournament": 3, - "score": 293, - "tens_count": 2, - "participated": true - } - ], - "total_score": 881, - "final_score": 0, - "tournaments_participated": 0 - }, - "7": { - "name": "Branko Pokeržnik", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 316, - "tens_count": 1, - "participated": true - }, - { - "tournament": 2, - "score": 332, - "tens_count": 3, - "participated": true - }, - { - "tournament": 3, - "score": 318, - "tens_count": 1, - "participated": true - } - ], - "total_score": 966, - "final_score": 0, - "tournaments_participated": 0 - }, - "9": { - "name": "Janez Božič", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 264, - "tens_count": 2, - "participated": true - }, - { - "tournament": 2, - "score": 276, - "tens_count": 0, - "participated": true - }, - { - "tournament": 3, - "score": 261, - "tens_count": 1, - "participated": true - } - ], - "total_score": 801, - "final_score": 0, - "tournaments_participated": 0 - }, - "10": { - "name": "Mitja Čeh", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 329, - "tens_count": 1, - "participated": true - }, - { - "tournament": 2, - "score": 312, - "tens_count": 4, - "participated": true - }, - { - "tournament": 3, - "score": 307, - "tens_count": 2, - "participated": true - } - ], - "total_score": 948, - "final_score": 0, - "tournaments_participated": 0 - }, - "11": { - "name": "Rado Kefer", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 275, - "tens_count": 0, - "participated": true - }, - { - "tournament": 2, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - }, - { - "tournament": 3, - "score": 314, - "tens_count": 3, - "participated": true - } - ], - "total_score": 589, - "final_score": 0, - "tournaments_participated": 0 - }, - "14": { - "name": "Karli Proje", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - }, - { - "tournament": 2, - "score": 0, - "tens_count": 0, - "participated": true - }, - { - "tournament": 3, - "score": 0, - "tens_count": 0, - "participated": true - } - ], - "total_score": 0, - "final_score": 0, - "tournaments_participated": 0 - }, - "15": { - "name": "Jan Pleterski", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 269, - "tens_count": 1, - "participated": true - }, - { - "tournament": 2, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - }, - { - "tournament": 3, - "score": 267, - "tens_count": 1, - "participated": true - } - ], - "total_score": 536, - "final_score": 0, - "tournaments_participated": 0 - }, - "16": { - "name": "Silvo Poročnik", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 293, - "tens_count": 3, - "participated": true - }, - { - "tournament": 2, - "score": 278, - "tens_count": 3, - "participated": true - }, - { - "tournament": 3, - "score": 282, - "tens_count": 3, - "participated": true - } - ], - "total_score": 853, - "final_score": 0, - "tournaments_participated": 0 - }, - "17": { - "name": "Dušan Onuk", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 313, - "tens_count": 4, - "participated": true - }, - { - "tournament": 2, - "score": 325, - "tens_count": 2, - "participated": true - }, - { - "tournament": 3, - "score": 192, - "tens_count": 3, - "participated": true - } - ], - "total_score": 830, - "final_score": 0, - "tournaments_participated": 0 - }, - "18": { - "name": "Matjaž Pleterski", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 280, - "tens_count": 2, - "participated": true - }, - { - "tournament": 2, - "score": 276, - "tens_count": 4, - "participated": true - }, - { - "tournament": 3, - "score": 307, - "tens_count": 0, - "participated": true - } - ], - "total_score": 863, - "final_score": 0, - "tournaments_participated": 0 - }, - "22": { - "name": "Doris Fesel", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - }, - { - "tournament": 2, - "score": 0, - "tens_count": 0, - "participated": true - }, - { - "tournament": 3, - "score": 0, - "tens_count": 0, - "participated": true - } - ], - "total_score": 0, - "final_score": 0, - "tournaments_participated": 0 - }, - "24": { - "name": "Jože Verdinek", - "joker_used": false, - "tournament_results": [ - { - "tournament": 1, - "score": 311, - "tens_count": 5, - "participated": true - }, - { - "tournament": 2, - "score": 315, - "tens_count": 5, - "participated": true - }, - { - "tournament": 3, - "score": 312, - "tens_count": 2, - "participated": true - } - ], - "total_score": 938, - "final_score": 0, - "tournaments_participated": 0 - }, - "50": { - "name": "Vid Ravnjak", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 302, - "tens_count": 6, - "participated": true - }, - { - "tournament": 2, - "score": 309, - "tens_count": 4, - "participated": true - }, - { - "tournament": 3, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - } - ], - "total_score": 611, - "final_score": 0, - "tournaments_participated": 0 - }, - "51": { - "name": "Robi Ovčar", - "joker_used": true, - "tournament_results": [ - { - "tournament": 1, - "score": 269, - "tens_count": 1, - "participated": true - }, - { - "tournament": 2, - "score": 0, - "tens_count": 0, - "participated": false, - "joker": true - }, - { - "tournament": 3, - "score": 265, - "tens_count": 1, - "participated": true - } - ], - "total_score": 534, - "final_score": 0, - "tournaments_participated": 0 - } - }, - "completed_tournaments": [ - { - "tournament_number": 1, - "tournament_type": "20_targets", - "finished_at": "2025-11-15T11:50:43.358782", - "results_summary": { - "participants": 15, - "shots_per_participant": 40, - "total_shots": 600, - "format_description": "20 Targets (2 shots each)" - } - }, - { - "tournament_number": 2, - "tournament_type": "20_targets", - "finished_at": "2025-12-13T12:13:29.550924", - "results_summary": { - "participants": 12, - "shots_per_participant": 40, - "total_shots": 480, - "format_description": "20 Targets (2 shots each)" - } - }, - { - "tournament_number": 3, - "tournament_type": "20_targets", - "finished_at": "2026-01-10T11:34:15.800129", - "results_summary": { - "participants": 14, - "shots_per_participant": 40, - "total_shots": 560, - "format_description": "20 Targets (2 shots each)" - } - } - ], - "league_finished": false -} \ No newline at end of file diff --git a/data/tournament_results.json b/data/tournament_results.json deleted file mode 100644 index 8a9718f..0000000 --- a/data/tournament_results.json +++ /dev/null @@ -1,1242 +0,0 @@ -{ - "tournament_id": "2026-01-10T09:59:15.945867", - "tournament_type": "20_targets", - "participants": { - "1": { - "name": "Domen Pleterski", - "targets": { - "1": { - "shot1": 6, - "shot2": 5 - }, - "2": { - "shot1": 8, - "shot2": 8 - }, - "3": { - "shot1": 9, - "shot2": 6 - }, - "4": { - "shot1": 9, - "shot2": 7 - }, - "5": { - "shot1": 9, - "shot2": 9 - }, - "6": { - "shot1": 10, - "shot2": 8 - }, - "7": { - "shot1": 9, - "shot2": 8 - }, - "8": { - "shot1": 8, - "shot2": 8 - }, - "9": { - "shot1": 9, - "shot2": 8 - }, - "10": { - "shot1": 9, - "shot2": 8 - }, - "11": { - "shot1": 8, - "shot2": 7 - }, - "12": { - "shot1": 10, - "shot2": 9 - }, - "13": { - "shot1": 9, - "shot2": 9 - }, - "14": { - "shot1": 8, - "shot2": 7 - }, - "15": { - "shot1": 8, - "shot2": 8 - }, - "16": { - "shot1": 9, - "shot2": 6 - }, - "17": { - "shot1": 8, - "shot2": 6 - }, - "18": { - "shot1": 7, - "shot2": 8 - }, - "19": { - "shot1": 9, - "shot2": 7 - }, - "20": { - "shot1": 9, - "shot2": 7 - } - }, - "total_score": 320, - "completed": true, - "joker_selected": false - }, - "10": { - "name": "Mitja Čeh", - "targets": { - "1": { - "shot1": 9, - "shot2": 8 - }, - "2": { - "shot1": 9, - "shot2": 7 - }, - "3": { - "shot1": 10, - "shot2": 9 - }, - "4": { - "shot1": 9, - "shot2": 7 - }, - "5": { - "shot1": 8, - "shot2": 8 - }, - "6": { - "shot1": 7, - "shot2": 5 - }, - "7": { - "shot1": 8, - "shot2": 7 - }, - "8": { - "shot1": 8, - "shot2": 5 - }, - "9": { - "shot1": 8, - "shot2": 7 - }, - "10": { - "shot1": 9, - "shot2": 8 - }, - "11": { - "shot1": 10, - "shot2": 8 - }, - "12": { - "shot1": 8, - "shot2": 0 - }, - "13": { - "shot1": 9, - "shot2": 9 - }, - "14": { - "shot1": 8, - "shot2": 8 - }, - "15": { - "shot1": 9, - "shot2": 8 - }, - "16": { - "shot1": 9, - "shot2": 7 - }, - "17": { - "shot1": 7, - "shot2": 5 - }, - "18": { - "shot1": 9, - "shot2": 7 - }, - "19": { - "shot1": 7, - "shot2": 7 - }, - "20": { - "shot1": 9, - "shot2": 7 - } - }, - "total_score": 307, - "completed": true, - "joker_selected": false - }, - "22": { - "name": "Doris Fesel", - "targets": { - "1": { - "shot1": 0, - "shot2": 0 - }, - "2": { - "shot1": 0, - "shot2": 0 - }, - "3": { - "shot1": 0, - "shot2": 0 - }, - "4": { - "shot1": 0, - "shot2": 0 - }, - "5": { - "shot1": 0, - "shot2": 0 - }, - "6": { - "shot1": 0, - "shot2": 0 - }, - "7": { - "shot1": 0, - "shot2": 0 - }, - "8": { - "shot1": 0, - "shot2": 0 - }, - "9": { - "shot1": 0, - "shot2": 0 - }, - "10": { - "shot1": 0, - "shot2": 0 - }, - "11": { - "shot1": 0, - "shot2": 0 - }, - "12": { - "shot1": 0, - "shot2": 0 - }, - "13": { - "shot1": 0, - "shot2": 0 - }, - "14": { - "shot1": 0, - "shot2": 0 - }, - "15": { - "shot1": 0, - "shot2": 0 - }, - "16": { - "shot1": 0, - "shot2": 0 - }, - "17": { - "shot1": 0, - "shot2": 0 - }, - "18": { - "shot1": 0, - "shot2": 0 - }, - "19": { - "shot1": 0, - "shot2": 0 - }, - "20": { - "shot1": 0, - "shot2": 0 - } - }, - "total_score": 0, - "completed": true, - "joker_selected": false - }, - "18": { - "name": "Matjaž Pleterski", - "targets": { - "1": { - "shot1": 9, - "shot2": 7 - }, - "2": { - "shot1": 9, - "shot2": 8 - }, - "3": { - "shot1": 8, - "shot2": 8 - }, - "4": { - "shot1": 9, - "shot2": 9 - }, - "5": { - "shot1": 8, - "shot2": 6 - }, - "6": { - "shot1": 8, - "shot2": 7 - }, - "7": { - "shot1": 9, - "shot2": 8 - }, - "8": { - "shot1": 8, - "shot2": 4 - }, - "9": { - "shot1": 9, - "shot2": 5 - }, - "10": { - "shot1": 8, - "shot2": 4 - }, - "11": { - "shot1": 9, - "shot2": 7 - }, - "12": { - "shot1": 8, - "shot2": 8 - }, - "13": { - "shot1": 8, - "shot2": 7 - }, - "14": { - "shot1": 8, - "shot2": 8 - }, - "15": { - "shot1": 9, - "shot2": 7 - }, - "16": { - "shot1": 8, - "shot2": 8 - }, - "17": { - "shot1": 9, - "shot2": 9 - }, - "18": { - "shot1": 7, - "shot2": 5 - }, - "19": { - "shot1": 8, - "shot2": 7 - }, - "20": { - "shot1": 9, - "shot2": 7 - } - }, - "total_score": 307, - "completed": true, - "joker_selected": false - }, - "17": { - "name": "Dušan Onuk", - "targets": { - "1": { - "shot1": 8, - "shot2": 8 - }, - "2": { - "shot1": 10, - "shot2": 7 - }, - "3": { - "shot1": 9, - "shot2": 8 - }, - "4": { - "shot1": 8, - "shot2": 6 - }, - "5": { - "shot1": 6, - "shot2": 7 - }, - "6": { - "shot1": 9, - "shot2": 8 - }, - "7": { - "shot1": 7, - "shot2": 7 - }, - "8": { - "shot1": 10, - "shot2": 8 - }, - "9": { - "shot1": 9, - "shot2": 7 - }, - "10": { - "shot1": 10, - "shot2": 4 - }, - "11": { - "shot1": 7, - "shot2": 7 - }, - "12": { - "shot1": 9, - "shot2": 1 - }, - "13": { - "shot1": 8, - "shot2": 4 - }, - "14": { - "shot1": 0, - "shot2": 0 - }, - "15": { - "shot1": 0, - "shot2": 0 - }, - "16": { - "shot1": 0, - "shot2": 0 - }, - "17": { - "shot1": 0, - "shot2": 0 - }, - "18": { - "shot1": 0, - "shot2": 0 - }, - "19": { - "shot1": 0, - "shot2": 0 - }, - "20": { - "shot1": 0, - "shot2": 0 - } - }, - "total_score": 192, - "completed": true, - "joker_selected": false - }, - "15": { - "name": "Jan Pleterski", - "targets": { - "1": { - "shot1": 9, - "shot2": 8 - }, - "2": { - "shot1": 7, - "shot2": 5 - }, - "3": { - "shot1": 7, - "shot2": 6 - }, - "4": { - "shot1": 8, - "shot2": 2 - }, - "5": { - "shot1": 7, - "shot2": 4 - }, - "6": { - "shot1": 7, - "shot2": 3 - }, - "7": { - "shot1": 6, - "shot2": 6 - }, - "8": { - "shot1": 8, - "shot2": 6 - }, - "9": { - "shot1": 8, - "shot2": 1 - }, - "10": { - "shot1": 9, - "shot2": 9 - }, - "11": { - "shot1": 8, - "shot2": 6 - }, - "12": { - "shot1": 9, - "shot2": 7 - }, - "13": { - "shot1": 9, - "shot2": 3 - }, - "14": { - "shot1": 9, - "shot2": 3 - }, - "15": { - "shot1": 8, - "shot2": 7 - }, - "16": { - "shot1": 7, - "shot2": 4 - }, - "17": { - "shot1": 10, - "shot2": 6 - }, - "18": { - "shot1": 8, - "shot2": 7 - }, - "19": { - "shot1": 8, - "shot2": 8 - }, - "20": { - "shot1": 9, - "shot2": 5 - } - }, - "total_score": 267, - "completed": true, - "joker_selected": false - }, - "51": { - "name": "Robi Ovčar", - "targets": { - "1": { - "shot1": 9, - "shot2": 7 - }, - "2": { - "shot1": 9, - "shot2": 4 - }, - "3": { - "shot1": 4, - "shot2": 1 - }, - "4": { - "shot1": 7, - "shot2": 6 - }, - "5": { - "shot1": 7, - "shot2": 6 - }, - "6": { - "shot1": 6, - "shot2": 2 - }, - "7": { - "shot1": 9, - "shot2": 5 - }, - "8": { - "shot1": 9, - "shot2": 8 - }, - "9": { - "shot1": 4, - "shot2": 4 - }, - "10": { - "shot1": 9, - "shot2": 9 - }, - "11": { - "shot1": 8, - "shot2": 6 - }, - "12": { - "shot1": 8, - "shot2": 8 - }, - "13": { - "shot1": 8, - "shot2": 4 - }, - "14": { - "shot1": 10, - "shot2": 8 - }, - "15": { - "shot1": 4, - "shot2": 2 - }, - "16": { - "shot1": 9, - "shot2": 7 - }, - "17": { - "shot1": 9, - "shot2": 6 - }, - "18": { - "shot1": 7, - "shot2": 7 - }, - "19": { - "shot1": 7, - "shot2": 7 - }, - "20": { - "shot1": 8, - "shot2": 7 - } - }, - "total_score": 265, - "completed": true, - "joker_selected": false - }, - "16": { - "name": "Silvo Poročnik", - "targets": { - "1": { - "shot1": 8, - "shot2": 1 - }, - "2": { - "shot1": 7, - "shot2": 7 - }, - "3": { - "shot1": 8, - "shot2": 8 - }, - "4": { - "shot1": 8, - "shot2": 7 - }, - "5": { - "shot1": 9, - "shot2": 6 - }, - "6": { - "shot1": 9, - "shot2": 5 - }, - "7": { - "shot1": 10, - "shot2": 8 - }, - "8": { - "shot1": 10, - "shot2": 7 - }, - "9": { - "shot1": 7, - "shot2": 6 - }, - "10": { - "shot1": 8, - "shot2": 7 - }, - "11": { - "shot1": 8, - "shot2": 4 - }, - "12": { - "shot1": 7, - "shot2": 4 - }, - "13": { - "shot1": 8, - "shot2": 5 - }, - "14": { - "shot1": 8, - "shot2": 8 - }, - "15": { - "shot1": 8, - "shot2": 6 - }, - "16": { - "shot1": 7, - "shot2": 2 - }, - "17": { - "shot1": 8, - "shot2": 6 - }, - "18": { - "shot1": 7, - "shot2": 7 - }, - "19": { - "shot1": 10, - "shot2": 9 - }, - "20": { - "shot1": 8, - "shot2": 6 - } - }, - "total_score": 282, - "completed": true, - "joker_selected": false - }, - "7": { - "name": "Branko Pokeržnik", - "targets": { - "1": { - "shot1": 9, - "shot2": 8 - }, - "2": { - "shot1": 8, - "shot2": 6 - }, - "3": { - "shot1": 9, - "shot2": 7 - }, - "4": { - "shot1": 9, - "shot2": 7 - }, - "5": { - "shot1": 9, - "shot2": 7 - }, - "6": { - "shot1": 8, - "shot2": 7 - }, - "7": { - "shot1": 7, - "shot2": 6 - }, - "8": { - "shot1": 9, - "shot2": 8 - }, - "9": { - "shot1": 8, - "shot2": 8 - }, - "10": { - "shot1": 8, - "shot2": 8 - }, - "11": { - "shot1": 8, - "shot2": 6 - }, - "12": { - "shot1": 7, - "shot2": 6 - }, - "13": { - "shot1": 10, - "shot2": 8 - }, - "14": { - "shot1": 9, - "shot2": 9 - }, - "15": { - "shot1": 8, - "shot2": 8 - }, - "16": { - "shot1": 9, - "shot2": 8 - }, - "17": { - "shot1": 9, - "shot2": 8 - }, - "18": { - "shot1": 9, - "shot2": 7 - }, - "19": { - "shot1": 9, - "shot2": 8 - }, - "20": { - "shot1": 8, - "shot2": 8 - } - }, - "total_score": 318, - "completed": true, - "joker_selected": false - }, - "9": { - "name": "Janez Božič", - "targets": { - "1": { - "shot1": 8, - "shot2": 6 - }, - "2": { - "shot1": 8, - "shot2": 4 - }, - "3": { - "shot1": 9, - "shot2": 6 - }, - "4": { - "shot1": 8, - "shot2": 8 - }, - "5": { - "shot1": 10, - "shot2": 8 - }, - "6": { - "shot1": 9, - "shot2": 7 - }, - "7": { - "shot1": 9, - "shot2": 8 - }, - "8": { - "shot1": 9, - "shot2": 8 - }, - "9": { - "shot1": 5, - "shot2": 5 - }, - "10": { - "shot1": 7, - "shot2": 5 - }, - "11": { - "shot1": 7, - "shot2": 6 - }, - "12": { - "shot1": 9, - "shot2": 6 - }, - "13": { - "shot1": 7, - "shot2": 6 - }, - "14": { - "shot1": 6, - "shot2": 2 - }, - "15": { - "shot1": 7, - "shot2": 4 - }, - "16": { - "shot1": 7, - "shot2": 3 - }, - "17": { - "shot1": 7, - "shot2": 5 - }, - "18": { - "shot1": 5, - "shot2": 3 - }, - "19": { - "shot1": 2, - "shot2": 4 - }, - "20": { - "shot1": 9, - "shot2": 9 - } - }, - "total_score": 261, - "completed": true, - "joker_selected": false - }, - "5": { - "name": "Jože Verhnjak", - "targets": { - "1": { - "shot1": 9, - "shot2": 8 - }, - "2": { - "shot1": 8, - "shot2": 2 - }, - "3": { - "shot1": 7, - "shot2": 8 - }, - "4": { - "shot1": 9, - "shot2": 6 - }, - "5": { - "shot1": 7, - "shot2": 6 - }, - "6": { - "shot1": 8, - "shot2": 7 - }, - "7": { - "shot1": 9, - "shot2": 7 - }, - "8": { - "shot1": 8, - "shot2": 7 - }, - "9": { - "shot1": 9, - "shot2": 6 - }, - "10": { - "shot1": 8, - "shot2": 2 - }, - "11": { - "shot1": 9, - "shot2": 6 - }, - "12": { - "shot1": 8, - "shot2": 8 - }, - "13": { - "shot1": 8, - "shot2": 4 - }, - "14": { - "shot1": 8, - "shot2": 6 - }, - "15": { - "shot1": 9, - "shot2": 7 - }, - "16": { - "shot1": 10, - "shot2": 8 - }, - "17": { - "shot1": 10, - "shot2": 7 - }, - "18": { - "shot1": 8, - "shot2": 8 - }, - "19": { - "shot1": 9, - "shot2": 8 - }, - "20": { - "shot1": 6, - "shot2": 5 - } - }, - "total_score": 293, - "completed": true, - "joker_selected": false - }, - "24": { - "name": "Jože Verdinek", - "targets": { - "1": { - "shot1": 9, - "shot2": 8 - }, - "2": { - "shot1": 9, - "shot2": 6 - }, - "3": { - "shot1": 9, - "shot2": 9 - }, - "4": { - "shot1": 8, - "shot2": 6 - }, - "5": { - "shot1": 8, - "shot2": 7 - }, - "6": { - "shot1": 8, - "shot2": 7 - }, - "7": { - "shot1": 8, - "shot2": 8 - }, - "8": { - "shot1": 9, - "shot2": 8 - }, - "9": { - "shot1": 9, - "shot2": 8 - }, - "10": { - "shot1": 8, - "shot2": 6 - }, - "11": { - "shot1": 9, - "shot2": 6 - }, - "12": { - "shot1": 8, - "shot2": 5 - }, - "13": { - "shot1": 9, - "shot2": 8 - }, - "14": { - "shot1": 9, - "shot2": 7 - }, - "15": { - "shot1": 6, - "shot2": 5 - }, - "16": { - "shot1": 9, - "shot2": 7 - }, - "17": { - "shot1": 10, - "shot2": 8 - }, - "18": { - "shot1": 10, - "shot2": 7 - }, - "19": { - "shot1": 9, - "shot2": 7 - }, - "20": { - "shot1": 9, - "shot2": 6 - } - }, - "total_score": 312, - "completed": true, - "joker_selected": false - }, - "14": { - "name": "Karli Proje", - "targets": { - "1": { - "shot1": 0, - "shot2": 0 - }, - "2": { - "shot1": 0, - "shot2": 0 - }, - "3": { - "shot1": 0, - "shot2": 0 - }, - "4": { - "shot1": 0, - "shot2": 0 - }, - "5": { - "shot1": 0, - "shot2": 0 - }, - "6": { - "shot1": 0, - "shot2": 0 - }, - "7": { - "shot1": 0, - "shot2": 0 - }, - "8": { - "shot1": 0, - "shot2": 0 - }, - "9": { - "shot1": 0, - "shot2": 0 - }, - "10": { - "shot1": 0, - "shot2": 0 - }, - "11": { - "shot1": 0, - "shot2": 0 - }, - "12": { - "shot1": 0, - "shot2": 0 - }, - "13": { - "shot1": 0, - "shot2": 0 - }, - "14": { - "shot1": 0, - "shot2": 0 - }, - "15": { - "shot1": 0, - "shot2": 0 - }, - "16": { - "shot1": 0, - "shot2": 0 - }, - "17": { - "shot1": 0, - "shot2": 0 - }, - "18": { - "shot1": 0, - "shot2": 0 - }, - "19": { - "shot1": 0, - "shot2": 0 - }, - "20": { - "shot1": 0, - "shot2": 0 - } - }, - "total_score": 0, - "completed": true, - "joker_selected": false - }, - "11": { - "name": "Rado Kefer", - "targets": { - "1": { - "shot1": 8, - "shot2": 7 - }, - "2": { - "shot1": 9, - "shot2": 6 - }, - "3": { - "shot1": 9, - "shot2": 7 - }, - "4": { - "shot1": 8, - "shot2": 8 - }, - "5": { - "shot1": 10, - "shot2": 8 - }, - "6": { - "shot1": 8, - "shot2": 8 - }, - "7": { - "shot1": 9, - "shot2": 7 - }, - "8": { - "shot1": 10, - "shot2": 8 - }, - "9": { - "shot1": 7, - "shot2": 6 - }, - "10": { - "shot1": 8, - "shot2": 7 - }, - "11": { - "shot1": 8, - "shot2": 6 - }, - "12": { - "shot1": 7, - "shot2": 4 - }, - "13": { - "shot1": 9, - "shot2": 9 - }, - "14": { - "shot1": 9, - "shot2": 8 - }, - "15": { - "shot1": 10, - "shot2": 8 - }, - "16": { - "shot1": 9, - "shot2": 7 - }, - "17": { - "shot1": 8, - "shot2": 8 - }, - "18": { - "shot1": 7, - "shot2": 8 - }, - "19": { - "shot1": 8, - "shot2": 8 - }, - "20": { - "shot1": 8, - "shot2": 7 - } - }, - "total_score": 314, - "completed": true, - "joker_selected": false - } - }, - "tournament_finished": true, - "created_at": "2026-01-10T09:59:15.947146", - "league_tournament_number": 3, - "finished_at": "2026-01-10T11:34:15.800055" -} \ No newline at end of file diff --git a/templates/league_scoreboard_display.html b/templates/league_scoreboard_display.html index c7efb70..b473b90 100644 --- a/templates/league_scoreboard_display.html +++ b/templates/league_scoreboard_display.html @@ -209,14 +209,14 @@ .champion-section { background: white; border-radius: 0 0 12px 12px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + box-shadow: none; padding: 12px; flex: 1; display: flex; flex-direction: column; - overflow: visible; + overflow: hidden; min-height: 0; - border-top: 1px solid #e9ecef; + border: 1px solid #e9ecef; } .champion-title { @@ -241,7 +241,7 @@ .champion-card { background: white; border-radius: 12px; - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); + box-shadow: none; padding: 12px 12px 18px 12px; display: flex; flex-direction: column; @@ -251,21 +251,12 @@ position: relative; overflow: hidden; border: 1px solid #e9ecef; - border-top: 6px solid; + border-top-width: 6px; justify-content: flex-end; } .champion-card::before { - content: ''; - position: absolute; - top: 6px; - left: 1px; - right: 1px; - bottom: 1px; - background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%); - pointer-events: none; - z-index: 1; - border-radius: 0 0 11px 11px; + display: none; } .champion-card:hover { @@ -432,10 +423,11 @@ .right-column { background: white; border-radius: 12px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + box-shadow: none; overflow: hidden; display: flex; flex-direction: column; + border: 1px solid #e9ecef; } .table-header { diff --git a/templates/results_display.html b/templates/results_display.html index d353cf4..5654370 100644 --- a/templates/results_display.html +++ b/templates/results_display.html @@ -220,8 +220,8 @@ flex-direction: column; overflow: visible; min-height: 0; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); - border-top: 1px solid #e9ecef; + box-shadow: none; + border: 1px solid #e9ecef; } .podium-title { @@ -245,7 +245,7 @@ .podium-card { background: white; border-radius: 12px; - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); + box-shadow: none; padding: 12px 12px 18px 12px; display: flex; flex-direction: column; @@ -254,7 +254,6 @@ transition: all 0.3s ease; position: relative; overflow: hidden; - border-top: 6px solid; border: 1px solid #e9ecef; border-top-width: 6px; justify-content: flex-end; @@ -274,7 +273,7 @@ } .podium-card:hover { - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); + box-shadow: none; } .podium-card.rank-1 { @@ -394,10 +393,11 @@ .right-column { background: white; border-radius: 12px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + box-shadow: none; overflow: hidden; display: flex; flex-direction: column; + border: 1px solid #e9ecef; } .table-header { diff --git a/tv_app.py b/tv_app.py index 8cacdf2..1017936 100644 --- a/tv_app.py +++ b/tv_app.py @@ -611,16 +611,16 @@ def view_archived_tournament(filename): """View archived tournament in results format""" if is_mobile_device(): return redirect(f'/mobile/archive/tournament/{filename}') - + filepath = os.path.join(ARCHIVE_DIR, filename) data = load_archive_file(filepath) - + if not data: return redirect('/archive') - + tournament_data = data.get('tournament', {}) results_data = data.get('results', {}) - + # Process results for display participants = [] for player_id, participant_data in results_data.get('participants', {}).items(): @@ -642,9 +642,18 @@ def view_archived_tournament(filename): # Add rankings for i, participant in enumerate(participants): participant['rank'] = i + 1 - + + # Sanitize tournament_data - convert to JSON-serializable format + sanitized_tournament = { + 'tournament_id': str(tournament_data.get('tournament_id', '')), + 'tournament_type': str(tournament_data.get('tournament_type', '20_targets')), + 'total_rounds': tournament_data.get('total_rounds', 1), + 'created_at': str(tournament_data.get('created_at', '')) + } + # Use the existing results display template but with archived data return render_template('results_display.html', + tournament=sanitized_tournament, results=results_data, participants=participants, archived=True, @@ -1154,7 +1163,15 @@ def results_display(): for i, participant in enumerate(participants): participant['rank'] = i + 1 + # Create sanitized tournament data for template + sanitized_tournament = { + 'tournament_id': str(results.get('tournament_id', '')), + 'tournament_type': str(results.get('tournament_type', '20_targets')), + 'total_rounds': results.get('total_rounds', 1) + } + return render_template('results_display.html', + tournament=sanitized_tournament, results=results, participants=participants, league=None, @@ -1734,9 +1751,19 @@ def api_dashboard_state(): response_data['current_round'] = tournament_state.get('current_round', 1) response_data['total_rounds'] = tournament_state.get('total_rounds', 1) - current_round_data = get_current_round_data() - if current_round_data: - response_data['player_names'] = [p['name'] for p in current_round_data.get('players', [])] + try: + current_round_data = get_current_round_data() + if current_round_data and isinstance(current_round_data, dict): + players = current_round_data.get('players', []) + if isinstance(players, list): + response_data['player_names'] = [ + str(p.get('name', 'Unknown')) if isinstance(p, dict) else 'Unknown' + for p in players if p + ] + except Exception as e: + # Log error but don't fail - player_names will remain empty list + print(f"Error getting player names for dashboard state: {e}") + response_data['player_names'] = [] if league_state: response_data['league_tournament'] = league_state.get('current_tournament', 1)