Skip to content

Sloppy answer fixes#4

Merged
rrusson merged 3 commits intomainfrom
SloppyAnswerFixes
Jan 26, 2026
Merged

Sloppy answer fixes#4
rrusson merged 3 commits intomainfrom
SloppyAnswerFixes

Conversation

@rrusson
Copy link
Copy Markdown
Owner

@rrusson rrusson commented Jan 26, 2026

Some clean-up of sloppy answer handling

Copilot AI review requested due to automatic review settings January 26, 2026 00:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens up “sloppy answer” handling so user guesses are evaluated more robustly, especially around messy artist/track strings, and slightly adjusts random track selection behavior.

Changes:

  • Refined SloppyAnswerComparer.AreCloseEnough to normalize into separate cleanAnswer/cleanGuess, explicitly reject empty normalized guesses, and add a “funky indicators” branch to handle multiple-artist / “feat.” / “ft.”-style cases more intelligently.
  • Updated MusicController.GuessArtist to pass the canonical metadata (artist/title) as the answer and the user input as the guess, and added targeted MSTest data-driven cases for the new sloppy-answer scenarios and null/empty/punctuation-only inputs.
  • Adjusted RandomTrackPicker’s invalid genre filter (adding "Ryan") and performed a tiny cosmetic cleanup in App.tsx.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
maimthattune.client/src/App.tsx Minor formatting cleanup at the end of the React app component (no behavioral impact).
MusicFinderTests/SloppyAnswerComparerTests.cs Expanded MSTest coverage for messy artist/track and null/empty/punctuation-only guesses; refactored a null/empty test into a [DataRow]-driven method.
MusicFinder/SloppyAnswerComparer.cs Central sloppy-answer comparison logic now uses normalized copies, explicitly rejects empty-normalized guesses, and adds a fallback branch for multi-artist/“featuring” strings via indicator-based splitting.
MusicFinder/RandomTrackPicker.cs Updated the _invalidGenres list to exclude an additional genre ("Ryan") from random selection.
MaimThatTune.Server/Controllers/MusicController.cs Corrected AreCloseEnough call order so the library’s canonical artist/title are passed as the answer and the user’s input as the guess.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rrusson rrusson merged commit 2496a30 into main Jan 26, 2026
1 check failed
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.

2 participants