Repository navigation
fix(dj): return DJ vibe and now playing when listening history is sparse - #926
LargeModGames merged 2 commits into
Conversation
history_outcome now ends in history_result. That helper builds one JSON object with period, total_plays, top_artists, top_tracks, top_albums, recent, now_playing, and vibe, and returns it through ToolOutcome::data_localized. A sparse brief still leads with history_sparse, and appends brief_now and brief_vibe when those values are set; a fuller brief still uses display_block. The changelog records this, and new tests call history_result with hand-built briefs for the vibe, the current track, shared keys, the five-play threshold, and a full brief. Fixes LargeModGames#830
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
On a profile with little listening history, the listening-history answer is a single sentence that says to ask what the listener feels like. A vibe stored just before that call, the track that is playing, and the structured fields are all missing, so the stored vibe looks like it was dropped. history_outcome writes the current track and the stored vibe onto the brief, then returns immediately when the brief is sparse.
That return is ToolOutcome::ok_localized around the history_sparse sentence and carries no structured payload, so the filled-in track and vibe never reach the caller.
history_outcome now ends in history_result. That helper builds one JSON object with period, total_plays, top_artists, top_tracks, top_albums, recent, now_playing, and vibe, and returns it through ToolOutcome::data_localized. A sparse brief still leads with history_sparse, and appends brief_now and brief_vibe when those values are set; a fuller brief still uses display_block. The changelog records this, and new tests call history_result with hand-built briefs for the vibe, the current track, shared keys, the five-play threshold, and a full brief.
Fixes #830
Testing
Ran
cargo test --no-default-features --features telemetry,tuilocally on macOS for the spotatui history_outcome change; it passed.cargo test --no-default-features --features telemetry,tui finished with every test passing.
cargo test -q -p spotatui stopped in the portaudio-sys build script before any tests ran.
Ran
cargo test --no-default-features --features telemetry,tuiin a Linux container (rust:1) for the spotatui history_outcome change; 1758 tests passed.Additional notes
💬 Questions or want to chat with other contributors? Join the spotatui Discord.
AI was used for assistance.
Summary by CodeRabbit