Merged
Conversation
Contributor
There was a problem hiding this comment.
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.AreCloseEnoughto normalize into separatecleanAnswer/cleanGuess, explicitly reject empty normalized guesses, and add a “funky indicators” branch to handle multiple-artist / “feat.” / “ft.”-style cases more intelligently. - Updated
MusicController.GuessArtistto pass the canonical metadata (artist/title) as theanswerand the user input as theguess, 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 inApp.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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some clean-up of sloppy answer handling