0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 21:53:54 +01:00

fix the function

This commit is contained in:
2025-04-01 19:00:49 +02:00
parent 48aadb6cdd
commit 66865c76c3

View File

@@ -58,19 +58,16 @@ def ensure_playlist_dir(day: str) -> str:
def calculate_category_percentages(playlists, days):
category_counts = {'morning': 0, 'day': 0, 'night': 0, 'late_night': 0}
polskie_counts = {'morning': 0, 'day': 0, 'night': 0, 'late_night': 0}
total_files = set()
total_polskie_files = set()
for day in days:
for category in category_counts.keys():
category_counts[category] += len(playlists[day][category])
for file in playlists[day][category]:
total_files.add(file)
category_counts[category] += 1
if "Polskie" in file:
polskie_counts[category] += 1
total_polskie_files.add(file)
total_count = len(total_files)
total_count = sum(category_counts.values())
if total_count == 0:
return None