Add Last.fm auto-sync and fix auto-tagging#247
Merged
Conversation
- Auto-sync: scrobbles are fetched automatically before tag/daily-summary queries if last sync is >30 minutes old (same pattern as Oura/RescueTime) - Retroactive tagging: new rules are applied to all existing scrobbles - Rule cleanup: deleting a rule also removes its auto-generated tags - Full re-tag: new POST /lastfm/retag endpoint and retag_lastfm_scrobbles MCP tool to delete all auto-tags and reapply all rules from scratch - New DB functions: hardDeleteTagsBySource, hardDeleteTagsByExternalIdPrefix, getAllScrobbles with integration tests - Updated api-spec with new response schemas Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #247 +/- ##
===========================================
+ Coverage 27.26% 27.31% +0.05%
===========================================
Files 176 176
Lines 23751 23863 +112
Branches 2122 2134 +12
===========================================
+ Hits 6476 6519 +43
- Misses 17236 17305 +69
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
POST /lastfm/retagendpoint andretag_lastfm_scrobblesMCP tool to delete all auto-tags and reapply all rules from scratchTest plan
lastfm-sync.test.ts(including newscrobbleRecordToScrobble,applyRuleRetroactively,cleanupRuleTags,retagAllScrobbles)tags.integration.test.tsforhardDeleteTagsBySourceandhardDeleteTagsByExternalIdPrefixtags_applied > 0for existing scrobblesretag_lastfm_scrobblesand verify full re-tag works🤖 Generated with Claude Code