From 3e8329e4b868efdecc704c2aefba14441fba520e Mon Sep 17 00:00:00 2001 From: Bernd Date: Sat, 26 Jul 2025 14:03:18 +0500 Subject: [PATCH] adding readme and season stats --- frontend.py | 23 ++++++++++++++++++++++- readme.md | 8 ++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 readme.md diff --git a/frontend.py b/frontend.py index 02476dc..129a4e8 100644 --- a/frontend.py +++ b/frontend.py @@ -154,7 +154,6 @@ class AnimeTracker(QMainWindow): self.setWindowTitle("Anime Backlog Tracker") # Add application icon icon_path = os.path.join(os.path.dirname(__file__), './icons/anime-app-icon.png') - print("icon_path = " + icon_path) if os.path.exists(icon_path): self.setWindowIcon(QIcon(icon_path)) self.resize(800, 600) @@ -402,7 +401,17 @@ class AnimeTracker(QMainWindow): comp_entries = 0 for season in ['winter', 'spring', 'summer', 'fall', '']: entries = self.backend.get_entries_for_season(year, season) + # Database schema order: + # 0: id + # 1: name + # 2: year + # 3: season + # 4: status + # 5: type + # 6: comment + # 7: url if entries: + # Season title s_name = season.capitalize() if season else 'Other' label = QLabel(s_name) season_font = QFont() @@ -410,6 +419,18 @@ class AnimeTracker(QMainWindow): season_font.setBold(True) label.setFont(season_font) layout.addWidget(label) + + # Season's stats + total_anime = len(entries) + completed_anime = sum(1 for entry in entries if entry[4] == 'completed') + completion_percentage = (completed_anime / total_anime * 100) if total_anime > 0 else 0 + s_stat = QLabel(f"Completed: {completed_anime}/{total_anime} ({completion_percentage:.0f}%)") + s_stat_font = QFont() + s_stat_font.setPointSize(int(10 * self.table_scale)) # Slightly smaller than season label + # s_stat_font.setItalic(True) # Optional: make it italic to differentiate + s_stat.setFont(s_stat_font) + layout.addWidget(s_stat) + table = CustomTableWidget(self, is_pre=False) table.is_pre = False self.tables.append(table) diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..a57520c --- /dev/null +++ b/readme.md @@ -0,0 +1,8 @@ +# How to build this app: +`python -m venv anime_env` +`source anime_env/bin/activate` +`pip install pyinstaller` +`pyinstaller build.spec --clean` + +# How to run this app without building: +`python frontend.py` \ No newline at end of file