Skip to content

Drop per-track MusicBrainz ISRC lookups from Last.fm recommendations#4190

Merged
OzGav merged 2 commits into
devfrom
lastfm-drop-isrc-lookup
Jun 13, 2026
Merged

Drop per-track MusicBrainz ISRC lookups from Last.fm recommendations#4190
OzGav merged 2 commits into
devfrom
lastfm-drop-isrc-lookup

Conversation

@OzGav

@OzGav OzGav commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What does this implement/fix?

Every resolved track fired a MusicBrainz ISRC lookup tripping the MB mirror's edge rate limit on the playback path. Tracks now resolve via the existing name search on streaming providers, with the artist verified against the result so same-titled covers don't slip through. Library dedup is unaffected: it already uses the external IDs returned by the streaming provider's own result.

Related issue (if applicable):

  • related issue

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate.

Every resolved track fired a MusicBrainz ISRC lookup, fanning out up to
25 MB calls per artist top-tracks request and tripping the MB mirror's
edge rate limit on the playback path. Tracks now resolve via the
existing name search on streaming providers, with the artist verified
against the result so same-titled covers don't slip through. Library
dedup is unaffected: it already uses the external IDs returned by the
streaming provider's own result.

@marcelveldt marcelveldt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is much better!
Thanks for persisting @OzGav !

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes per-track MusicBrainz ISRC enrichment from the Last.fm recommendations resolution path to prevent hitting MusicBrainz mirror edge rate limits during playback, relying instead on streaming-provider search with artist+title verification.

Changes:

  • Removed MusicBrainz ISRC lookup and concurrency limiter from Last.fm track parsing/resolution.
  • Updated provider search resolution to verify matches by title (with “Artist - Title” handling) and artist name when available.
  • Updated comments/constants to reflect the new provider-search-based resolution behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
music_assistant/providers/lastfm_recommendations/recommendations.py Updates comments to reflect removal of MusicBrainz ISRC lookups.
music_assistant/providers/lastfm_recommendations/parsers.py Removes ISRC enrichment via MusicBrainz and switches resolution matching to artist+title verification.
music_assistant/providers/lastfm_recommendations/constants.py Removes MB_ISRC_CONCURRENCY_LIMIT and adjusts related buffer rationale text.

Comment thread music_assistant/providers/lastfm_recommendations/parsers.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@OzGav OzGav merged commit e0f11cf into dev Jun 13, 2026
9 checks passed
@OzGav OzGav deleted the lastfm-drop-isrc-lookup branch June 13, 2026 11:42
github-actions Bot pushed a commit that referenced this pull request Jun 13, 2026
…4190)

# What does this implement/fix?

<!-- Quick description and explanation of changes. -->

Every resolved track fired a MusicBrainz ISRC lookup tripping the MB
mirror's edge rate limit on the playback path. Tracks now resolve via
the existing name search on streaming providers, with the artist
verified against the result so same-titled covers don't slip through.
Library dedup is unaffected: it already uses the external IDs returned
by the streaming provider's own result.

**Related issue (if applicable):**

- related issue <link to issue>

## Types of changes

<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives
the label from the ticked box and applies it automatically; the
release-notes generator uses that same label to slot this change
into the next release notes.
-->

- [X] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [ ] New feature (non-breaking change which adds functionality) —
`new-feature`
- [ ] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`

## Checklist

- [X] The code change is tested and works locally.
- [X] `pre-commit run --all-files` passes.
- [X] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [ ] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [ ] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [X] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have raised a PR against the documentation repository targeting
the main or beta branch as appropriate.

---------

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
marcelveldt added a commit that referenced this pull request Jun 13, 2026
…4190)

# What does this implement/fix?

<!-- Quick description and explanation of changes. -->

Every resolved track fired a MusicBrainz ISRC lookup tripping the MB
mirror's edge rate limit on the playback path. Tracks now resolve via
the existing name search on streaming providers, with the artist
verified against the result so same-titled covers don't slip through.
Library dedup is unaffected: it already uses the external IDs returned
by the streaming provider's own result.

**Related issue (if applicable):**

- related issue <link to issue>

## Types of changes

<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives
the label from the ticked box and applies it automatically; the
release-notes generator uses that same label to slot this change
into the next release notes.
-->

- [X] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [ ] New feature (non-breaking change which adds functionality) —
`new-feature`
- [ ] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`

## Checklist

- [X] The code change is tested and works locally.
- [X] `pre-commit run --all-files` passes.
- [X] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [ ] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [ ] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [X] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have raised a PR against the documentation repository targeting
the main or beta branch as appropriate.

---------

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
anatosun pushed a commit to anatosun/music-assistant-server that referenced this pull request Jun 14, 2026
…usic-assistant#4190)

# What does this implement/fix?

<!-- Quick description and explanation of changes. -->

Every resolved track fired a MusicBrainz ISRC lookup tripping the MB
mirror's edge rate limit on the playback path. Tracks now resolve via
the existing name search on streaming providers, with the artist
verified against the result so same-titled covers don't slip through.
Library dedup is unaffected: it already uses the external IDs returned
by the streaming provider's own result.

**Related issue (if applicable):**

- related issue <link to issue>

## Types of changes

<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives
the label from the ticked box and applies it automatically; the
release-notes generator uses that same label to slot this change
into the next release notes.
-->

- [X] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [ ] New feature (non-breaking change which adds functionality) —
`new-feature`
- [ ] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`

## Checklist

- [X] The code change is tested and works locally.
- [X] `pre-commit run --all-files` passes.
- [X] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [ ] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [ ] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [X] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have raised a PR against the documentation repository targeting
the main or beta branch as appropriate.

---------

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants