Update viu_media/assets/scripts/fzf/dynamic_preview.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Benedict Xavier
2025-12-31 18:52:57 +03:00
committed by GitHub
parent a826f391c1
commit 8c5b066019

View File

@@ -49,8 +49,8 @@ def format_score_stars(score):
"""Format score as stars out of 6."""
if score is None:
return "N/A"
# Convert 0-100 score to 0-6 stars
stars = round(score / 100 * 6)
# Convert 0-100 score to 0-6 stars, capped at 6 for consistency
stars = min(round(score * 6 / 100), 6)
return "" * stars + f" ({score}/100)"