Repository navigation
refactor: extract lastFmSeeder from queueManipulation (phase 1.1) - #665
LucasSantana-Dev wants to merge 1 commit into
Conversation
Extract collectLastFmCandidates function to dedicated lastFmSeeder.ts module as part of Phase 1.1 of queueManipulation refactor. Maintains strict behavior preservation with all 131 existing tests passing. ## Changes - **New file**: packages/bot/src/utils/music/autoplay/lastFmSeeder.ts (267 LOC) - collectLastFmCandidates() - main Last.fm seeding function - Internal helper functions for candidate filtering and scoring - Dependencies: searchLastFmQuery, calculateRecommendationScore imported from queueManipulation - **Modified file**: packages/bot/src/utils/music/queueManipulation.ts (-134 LOC) - Removed collectLastFmCandidates function body - Exported searchLastFmQuery and calculateRecommendationScore for lastFmSeeder dependency - Re-imported collectLastFmCandidates for backward compatibility ## Testing - All 131 queueManipulation tests pass - No behavior changes - pure extraction - Circular dependency avoided by keeping searchLastFmQuery and calculateRecommendationScore in queueManipulation ## Phase 1 Status Part of Lucky refactor plan Phase 1: Breaking up queueManipulation.ts god object. Prior phases: #658 candidateScorer, #659 diversitySelector, #662 spotifyRecommender Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
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 23 minutes and 52 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
|
Superseded by #668 which includes a thorough 297 LOC test suite for lastFmSeeder. Closing to avoid duplicate refactor merge conflict. |
Pull request was closed


Summary
Extracted
collectLastFmCandidatesfunction from the 2,070-LOC queueManipulation.ts god-object into a new dedicated autoplay/lastFmSeeder.ts module as Phase 1.1 of the multi-phase refactor.Changes
New file: packages/bot/src/utils/music/autoplay/lastFmSeeder.ts (267 LOC)
collectLastFmCandidates()- main Last.fm seeding function for autoplayshouldIncludeCandidate(),upsertScoredCandidate(),normalizeTrackKey(), etc.Modified file: packages/bot/src/utils/music/queueManipulation.ts (reduced by 134 LOC)
collectLastFmCandidatesfunction body (lines 1117-1250)searchLastFmQueryandcalculateRecommendationScorefor lastFmSeeder importscollectLastFmCandidatesfor backward compatibility with existing call inreplenishQueue()Testing
Phase Status
Phase 1.1 Complete: Part of Lucky refactor plan Phase 1 - Breaking up queueManipulation.ts god object.
Prior Phases Shipped:
Approach Consistency:
This extraction follows the established pattern from prior phases:
Metrics