diff --git a/backend/routers/performances.py b/backend/routers/performances.py index 89987d9..9cb1a68 100644 --- a/backend/routers/performances.py +++ b/backend/routers/performances.py @@ -145,10 +145,12 @@ def read_performance(slug: str, session: Session = Depends(get_session)): total_versions = len(all_perfs_data) - # Heady = top 20% with at least 1 rating and avg >= 8.0 + # Heady = #1 ranked with avg >= 8.0 OR top 20% with at least 1 rating and avg >= 8.0 is_heady = False if current_rating_count > 0 and current_avg >= 8.0: - if rank and total_versions > 0: + if rank == 1: # Top ranked version always heady if avg >= 8.0 + is_heady = True + elif rank and total_versions > 0: percentile = rank / total_versions is_heady = percentile <= 0.2 # Top 20%