mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-09-12 02:58:31 +00:00
fix(career): exclude orphaned song_stats from star totals
Codex preflight: scans hide rather than delete stats of removed songs, so stars now apply the same existing-song filter other stats surfaces use (filename IN (SELECT filename FROM songs)). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
0cc08ebebf
commit
99b6d3c384
@@ -70,8 +70,11 @@ def _stars():
|
||||
if db is None:
|
||||
return 0, {}
|
||||
thresholds = _state["content"]["star_accuracy_thresholds"]
|
||||
# Existing-song filter: a scan hides (not deletes) stats of songs removed
|
||||
# from the library, so orphaned rows must not keep counting toward stars.
|
||||
rows = db.conn.execute(
|
||||
"SELECT filename, MAX(best_accuracy) FROM song_stats GROUP BY filename"
|
||||
"SELECT filename, MAX(best_accuracy) FROM song_stats "
|
||||
"WHERE filename IN (SELECT filename FROM songs) GROUP BY filename"
|
||||
).fetchall()
|
||||
per_song = {}
|
||||
for filename, acc in rows:
|
||||
|
||||
Reference in New Issue
Block a user