Skip to content

fix(bot): strip Brazilian version qualifiers from track titles for dedup - #584

Merged
LucasSantana-Dev merged 2 commits into
mainfrom
fix/autoplay-dedup-version-variants
Apr 13, 2026
Merged

LucasSantana-Dev merged 2 commits into
mainfrom
fix/autoplay-dedup-version-variants

Conversation

@LucasSantana-Dev

Copy link
Copy Markdown
Owner

Problem

Autoplay was playing different versions of the same song — e.g. the original "Halo" followed by "Halo (Versão Forró)" or "Halo - Versão Forró". These have the same song core but the dedup system treated them as distinct tracks.

Root Cause

cleanTitle didn't strip Brazilian/Portuguese version descriptors, so:

  • "Halo (Versão Forró)" → normalized to "haloversoforró" (≠ "halo")
  • "Halo - Versão Forró" → normalized to "haloversoforró" (≠ "halo")
  • "Evidências - Ao Vivo" → normalized to "evidenciasaovivo" (≠ "evidencias")

Fix

Two additions to searchQueryCleaner.ts:

NOISE_PATTERNS — strip parenthetical forms:

  • (Versão Forró), (Versão Acústica), [Versão ...]
  • (Ao Vivo), [Ao Vivo]

HYPHENATED_VERSION_SUFFIXES — strip hyphenated forms:

  • Song - Versão Forró → Song
  • Song - Ao Vivo em São Paulo → Song
  • Song - Forró → Song

The "Beyoncé - Halo - Versão Forró" (artist-prefix) case was already handled by extractSongCore's inner-sep trim — no change needed there.

Tests

8 new cleanTitle tests covering each new pattern. All 2149 bot tests pass.

Builds on #583 (merged).

@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@LucasSantana-Dev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 26 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 26 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f81fae0d-35e9-4a08-a19e-ca2d3e733902

📥 Commits

Reviewing files that changed from the base of the PR and between 0b7117f and f8cfced.

📒 Files selected for processing (2)
  • packages/bot/src/utils/music/searchQueryCleaner.spec.ts
  • packages/bot/src/utils/music/searchQueryCleaner.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/autoplay-dedup-version-variants

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel

vercel Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Apr 13, 2026 1:11pm

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit 82915dc into main Apr 13, 2026
12 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the fix/autoplay-dedup-version-variants branch April 13, 2026 13:15

This branch was successfully deployed

1 active deployment
Preview — f8cfced7 Deployed Apr 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant