Skip to content

Migrate music lookups from Last.fm to ListenBrainz - #187

Merged
variablenix merged 1 commit into
mainfrom
feature/listenbrainz-migration
Nov 20, 2026
Merged

variablenix merged 1 commit into
mainfrom
feature/listenbrainz-migration

Conversation

@variablenix

@variablenix variablenix commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Replace Last.fm lookups with public, keyless ListenBrainz current/recent-track endpoints.
  • Add !listenbrainz and !lb, preserve !np and !last, and retain !lastfm as a documented ListenBrainz compatibility alias.
  • Share provider rate limiting across networks; bound deadlines, response bodies and concurrent work; reject redirects and sanitize IRC/terminal output.
  • Scope new saved defaults by network and authenticated account (nickname fallback for guests). Preserve legacy Last.fm records without assuming cross-service username ownership.
  • Translate legacy enabled settings and channel opt-outs in memory; explicit ListenBrainz settings take precedence.
  • Reuse the existing terminal-safe sanitizer for music, IMDb and YouTube without changing its filtering behavior. Update examples and migration guidance.

Validation

  • Go 1.27.4: go test -race ./..., including offline Chrome fixtures
  • go vet ./..., staticcheck and trimmed binary build
  • govulncheck: no vulnerabilities found
  • Gitleaks staged-patch scan: no leaks found
  • GitHub Verify, Analyze Go and CodeQL checks passed
  • Opt-in real API command-handler checks against empty and populated public histories, without credentials or IRC traffic
  • Focused alias, storage-failure, account/network isolation, config compatibility, input/output, rate-limit and cancellation regressions

Migration and deployment

This changes GoBot music lookups only: GoBot does not submit scrobbles or import listening history. A player/scrobbler must be configured separately for ListenBrainz.

Existing lastfm configuration is accepted; old API keys are ignored. Users must run !listenbrainz <ListenBrainz username> once to set a new default. No database migration is required. Other installations must rebuild and restart after upgrading.

Merged and deployed revision 74ec6d9. The production host passed focused Linux regressions and a live public lookup, then rebuilt with Go 1.26.11 and restarted successfully. The running executable reports the expected revision and an unmodified source tree. Both IRC networks reconnected, all four configured channel memberships were restored, and metrics/stats endpoints are healthy. Production configuration, environment and certificate checksums are unchanged.

@variablenix
variablenix merged commit 74ec6d9 into main Nov 20, 2026
3 checks passed
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.

1 participant