Skip to content

fix(recap): first listens, mood words and artist spelling (ADR-0156) - #422

Merged
jeffcrouse merged 1 commit into
mainfrom
fix/recap-first-listens-moods
Oct 31, 2026
Merged

jeffcrouse merged 1 commit into
mainfrom
fix/recap-first-listens-moods

Conversation

@jeffcrouse

Copy link
Copy Markdown
Member

Summary

These come from the first run of #421 against the NAS. Its totals matched a SQL count exactly (2,066 plays, 9,773.2 minutes since Aug 1), but three things a slide would show were wrong:

  • first_listens counted skipped tracks, so it came out at 1,457 against 1,322 unique_tracks. It now counts only tracks played through, which makes it a subset.
  • Mood words counted every mood_tags category. Genre, instrumentation and energy tags share that field, so the year read "blues, rock, country". Only category == "mood" counts now.
  • Top tracks used the file's artist tag ("Boards Of Canada") while top artists used the canonical name ("Boards of Canada"). Both use the canonical name now.

ADR-0156's Implementation block records these, plus one finding left for the client to handle: the library-wide medians are energy 0.83, valence 0.85 and danceability 0.15, so the raw "sound" medians aren't absolutes.

No schema change. The new artist_id is internal to the service and isn't in the response.

Test plan

  • tests/test_recap.py: 20 pass. The new and changed tests (canonical spelling, mood category, skipped tracks aren't first listens) each fail against main's recap.py.
  • ruff, mypy, dump_openapi --check, check_docs.py
  • After merge: make deploy-dev and re-run the NAS check

🤖 Generated with Claude Code

Found on the first run against the NAS, whose totals otherwise matched a
SQL count exactly (2,066 plays, 9,773.2 minutes):

- first_listens counted skipped tracks too, and came out larger than
  unique_tracks (1,457 against 1,322). It now counts tracks played
  through, so it is a subset.
- The sound's mood words counted every category in mood_tags, so a year
  of Interpol and Boards of Canada read "blues, rock, country". Only
  category "mood" counts now.
- Top tracks showed the file's artist tag ("Boards Of Canada") beside the
  canonical name on the artists slide ("Boards of Canada").

The ADR records a fourth finding: the library-wide medians of energy and
valence are 0.83 and 0.85, so the raw medians are not absolutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffcrouse
jeffcrouse merged commit 399a776 into main Oct 31, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant