mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-07-31 00:09:16 +02:00
fix???
This commit is contained in:
+9
-7
@@ -214,14 +214,16 @@ def draw_interface(audio_files: list, playlists: dict, selected_idx: int, curren
|
|||||||
category_bar += f"{category[:4].capitalize()}: {percent:.1f}% (P:{polskie_percent:.1f}%) | "
|
category_bar += f"{category[:4].capitalize()}: {percent:.1f}% (P:{polskie_percent:.1f}%) | "
|
||||||
category_bar += f"TP:{total_pl:0.1f}% | "
|
category_bar += f"TP:{total_pl:0.1f}% | "
|
||||||
|
|
||||||
assigned = 0
|
assigned_files = set()
|
||||||
categories = ['late_night', 'morning', 'day', 'night']
|
categories = ['late_night', 'morning', 'day', 'night']
|
||||||
for category in categories:
|
for day in get_days_of_week():
|
||||||
for day in get_days_of_week():
|
for category in categories:
|
||||||
for file in playlists[day][category]:
|
assigned_files.update(playlists[day][category])
|
||||||
assigned += 1
|
|
||||||
assigned /= len(get_days_of_week())
|
total_files = len(audio_files)
|
||||||
unassigned = ((len(audio_files)-assigned) / len(audio_files))*100
|
assigned_count = len(assigned_files)
|
||||||
|
unassigned = ((total_files - assigned_count) / total_files) * 100 if total_files > 0 else 0
|
||||||
|
|
||||||
category_bar += f"UA:{unassigned:0.1f}%"
|
category_bar += f"UA:{unassigned:0.1f}%"
|
||||||
|
|
||||||
if len(category_bar) > term_width - 2:
|
if len(category_bar) > term_width - 2:
|
||||||
|
|||||||
Reference in New Issue
Block a user