Skip to content

Surface Bandcamp label-released performers as their own artists#3824

Draft
teancom wants to merge 3 commits into
devfrom
fix/bandcamp-artists
Draft

Surface Bandcamp label-released performers as their own artists#3824
teancom wants to merge 3 commits into
devfrom
fix/bandcamp-artists

Conversation

@teancom
Copy link
Copy Markdown
Contributor

@teancom teancom commented Apr 30, 2026

Albums published on a band's page by a different performer (Mortaja on audiophob, The Green Arrows on Analog Africa) used to be filed under the page owner. They now get a synthetic artist ID {band_id}:{performer_slug} — scoped per band page so cross-page same-name performers stay distinct. Synthetic IDs that match the page-owner's own slug short-circuit back to the real band on resolve, collapsing any search-time drift before it can persist.

Fixes music-assistant/support#5389

Depends on ALERTua/bandcamp_async_api#23

Albums published on a band's page by a different performer (Mortaja on
audiophob, The Green Arrows on Analog Africa) used to be filed under
the page owner. They now get a synthetic artist ID
`{band_id}:{performer_slug}` — scoped per band page so cross-page
same-name performers stay distinct. Synthetic IDs that match the
page-owner's own slug short-circuit back to the real band on resolve,
collapsing any search-time drift before it can persist.

Refs music-assistant/support#5389.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

🔒 Dependency Security Report

📦 Modified Dependencies

music_assistant/providers/bandcamp/manifest.json

Added:

Removed:

The following dependencies were added or modified:

diff --git a/requirements_all.txt b/requirements_all.txt
index 2122c875..7af7c911 100644
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -24,7 +24,7 @@ audible==0.10.0
 auntie-sounds==1.1.8
 av==16.1.0
 awesomeversion>=24.6.0
-bandcamp-async-api==0.1.1
+bandcamp-async-api==0.2.1
 beat-this==1.1.0
 bidict==0.23.1
 certifi==2025.11.12

New/modified packages to review:

  • bandcamp-async-api==0.2.1

🔍 Vulnerability Scan Results

No known vulnerabilities found

Name Skip Reason
torch Dependency not found on PyPI and could not be audited: torch (2.11.0+cpu)
torchaudio Dependency not found on PyPI and could not be audited: torchaudio (2.11.0+cpu)
✅ No known vulnerabilities found

Automated Security Checks

  • Vulnerability Scan: Passed - No known vulnerabilities
  • Trusted Sources: All packages have verified source repositories
  • Typosquatting Check: No suspicious package names detected
  • License Compatibility: All licenses are OSI-approved and compatible
  • Supply Chain Risk: Passed - packages appear mature and maintained

Manual Review

Maintainer approval required:

  • I have reviewed the changes above and approve these dependency updates

To approve: Comment /approve-dependencies or manually add the dependencies-reviewed label.

@teancom teancom added the dependencies-reviewed Indication that any added or modified/updated dependencies on a PR have been reviewed label Apr 30, 2026
@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented Apr 30, 2026

@ALERTua I've been testing this over the past few days, I think this solves most of the label-as-band issues?

@ALERTua
Copy link
Copy Markdown
Contributor

ALERTua commented May 1, 2026

Search by "Night Moves" album https://hipdozer.bandcamp.com/album/night-moves, which is Apollo Brown, but hosted on the label Hip Dozer

On dev:

image

Clicking the artist name:

image

On this PR:

image

Clicking the artist name:

image

I'm not sure this is consistent.


Search by "the green arrows" artist

On dev:

image

On this PR:

image image

This is definitely good!


In this PR, it is possible to search for an artist who is hosted only on a label. It's impossible on the dev.

So the only issue I see is that within such an album (e.g., Night Moves), there's no way to go to the label page. But is it bad? Only for the music exploration. And I doubt MA is a music exploration-focused app.

Looks good to me. Could be better, but I can't think of a way to make it more comprehensive in the reality of the Bandcamp structure.

The number of Bandcamp workarounds is increasing. I hope they are not planning to change any of the core structures, as this code is becoming less and less readable, alas. Maybe, at some point, we will have to rewrite this integration from scratch. But it's OK.

Builds on the synthetic `{band_id}:{slug}` artist ID for albums released
on a label's page by a different performer. When the performer has
their own Bandcamp band page (Apollo Brown, Mortaja, …), a secondary
autocomplete lookup redirects to the real `{band_id}` so direct-search
and search-by-album-name surface the same artist. When no own band page
exists, resolution falls back to the synthetic ID.

Wired into search, get_album, get_track, get_album_tracks, and the
artist discography listing. Lookups for a batch resolve in parallel and
are cached per performer slug.

Refs music-assistant/support#5389.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented May 2, 2026

@ALERTua I was focusing only on Mortaja with the first commit, completely forgot to test the other bands. This is now, I believe, an approach that handles all of the various edge cases.

I agree it's getting a bit convoluted, hopefully we're nearing the end of the edge-case road? All my fingers are crossed...

@ALERTua
Copy link
Copy Markdown
Contributor

ALERTua commented May 3, 2026

In this commit, searching for "Night Moves" brings me the correct album

image

But clicking the performer title I am redirected to an unexpected artist page

image

which does not have the album I was redirected from, as the album is published on the Hip Dozer label.
While the artist is correct in this case, it is just one of their pages, similar only by the performer's name.
I cannot say I am a fan of this behavior, as it can produce false redirections, and I wish the performer title redirected to the label page, not an assumed artist page.
While all this is irrelevant for the users who know what they are looking for, it has impact on the music exploration user journey, which, as I imagine, is not the goal of MA.

Copy link
Copy Markdown
Contributor

@OzGav OzGav left a comment

Choose a reason for hiding this comment

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

There are a number of other multi-line docstrings to have the first line dropped down to match the indentation of the following text that I didn't put a suggestion on but they all need doing just as a point of standardisation.

Comment thread music_assistant/providers/bandcamp/__init__.py Outdated
Comment thread music_assistant/providers/bandcamp/__init__.py Outdated
Comment thread music_assistant/providers/bandcamp/__init__.py Outdated
Comment thread music_assistant/providers/bandcamp/__init__.py Outdated
Comment thread music_assistant/providers/bandcamp/__init__.py Outdated
Comment thread music_assistant/providers/bandcamp/converters.py Outdated
Comment thread music_assistant/providers/bandcamp/converters.py Outdated
Comment thread music_assistant/providers/bandcamp/converters.py Outdated
Comment thread music_assistant/providers/bandcamp/converters.py Outdated
Comment thread music_assistant/providers/bandcamp/converters.py Outdated
- Reformat multi-line docstrings to project standard (description on
  its own line below the opening triple-quote).
- Strip implementation details from docstrings; relocate the still-useful
  bits to inline comments and add a Sphinx :param: to _fetch_discography.
- Log a warning when BandcampAPIError is swallowed in
  _fetch_performer_band_id so it matches the rest of the file's
  error-handling convention.
@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented May 3, 2026

@ALERTua I think I've tightened this up as much as I can, without doing full discography o^n-style searches (which would make us bad API users and have a not-great - meaning slow - user experience). If how this branch works overall is - in your eyes - a regression or even just a 'no-op', then let's drop it, no harm, no foul, no use changing behavior and adding code without making some sort of progress. I will truly not be offended. I think this works better for more use-cases, but it's definitely not perfect.

@OzGav
Copy link
Copy Markdown
Contributor

OzGav commented May 3, 2026

No at the end of the day I think it should work how the users expect, as best as you can.

On the false-redirect behaviour you identified, if it can’t be fixed then I think a note in the docs would be required.

Will see what Marvin thinks when he reveiws.

Copy link
Copy Markdown
Contributor

@MarvinSchenkel MarvinSchenkel left a comment

Choose a reason for hiding this comment

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

This looks good to me code wise, but I cannot judge this functionally as I am not a Bandcamp user. I have one question before I merge it. Is it possible to (partly) reuse the helper logic we already have in helpers/compare.py for comparing band and performers?

@ALERTua
Copy link
Copy Markdown
Contributor

ALERTua commented May 4, 2026

Okay, trying to look at the label-published artists' behavior from the user perspective.
I will omit the "All" search mode, as I don't like it and want it gone.

  1. I'm looking for all Apollo Brown albums (they have their own page and label-published albums)
    I'm entering "Apollo Brown" in the "Album" mode search.
    I'm seeing all Apollo Brown albums from their pages and the label pages.
    Good.

  2. I'm looking for the "The Green Arrows" artist.
    I'm entering "The Green Arrows" in the "Artists" mode search.
    Got their virtual artist, got their one album, got the link to their label.
    Good.

  3. I'm looking for the "Apollo Brown" artist in the "Artists" search mode.
    Got all their pages and collaboration artists that mention them. All of the Apollo Brown pages. This way, I cannot find their album that was published on a label. That's expected. Can we do better without overloading the API? No.
    OK.

  4. I'm looking for a song from an album that is published on a label, from this song I want its album, from its album I want all albums.
    I'm entering "Moon at Midnight" song into the "Tracks" search mode.
    I got "Moon at Midnight" from "Night Moves" by "Apollo Brown". Good.
    Navigating to the song, I can navigate to the album. Night Moves by Apollo Brown. Got the URL for the album on the label's page. Clicking on the author's name I was navigated to

image

which is a wild guess that is a coincidence.
We are navigating the user from an album to the artist who does not have this album. Not OK.
Another try: with a song from "The Green Arrows".
Searching for Madzangara Dzimu in the "Tracks" search mode. Got the track. Navigating to the album. All good. Navigating to the artist. Got the virtual artist's page.
Good.

Let's say, we are navigating the user to the wild-guessed artist page, and it is effective in 75% cases. Good enough. We will do better if the users provide us the edge-cases we can fix.

What user scenarios do we have more? "Browse".

I'm following Analog Africa and I want to brows my "Following" to search for "The Green Arrows".
Navigating to Browse→Bandcamp→Following
The page is stuck. Exception:

2026-05-04 09:39:50.428 ERROR (MainThread) [music_assistant.webserver] Error handling message: music/browse: 'int' object has no attribute 'partition'

_ids.py:72
https://github.com/music-assistant/server/pull/3824/changes#diff-748edd462bf55e5abb80bfa3e6733b576285d42fb762b4f521afdb617f5f853dR72

Let's fix this one, make sure the Browse works correctly with both artist pages and virtual artists and all this looks good to me.

@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented May 4, 2026

I, just last night, left on a 3 week vacation with no laptop (I'm very excited). I can address those when I get back or you can push into the branch, I'm happy either way. ❤️

@MarvinSchenkel
Copy link
Copy Markdown
Contributor

Gonna set this to 'draft' just to be able to keep track of things that need my attention. Please mark it as ready for review again when you want me to have a look

@MarvinSchenkel MarvinSchenkel marked this pull request as draft May 6, 2026 07:28
@ALERTua
Copy link
Copy Markdown
Contributor

ALERTua commented May 6, 2026

Sorry, got no energy to spend even an hour on this now. Things got quite emotionally destabilizing for me here in Kyiv, Ukraine.
I will try to find strength before Teancom arrives. Otherwise, no rush, this waits.

@MarvinSchenkel
Copy link
Copy Markdown
Contributor

Sorry, got no energy to spend even an hour on this now. Things got quite emotionally destabilizing for me here in Kyiv, Ukraine. I will try to find strength before Teancom arrives. Otherwise, no rush, this waits.

Sorry to hear that. All the best and of course, no rush!

@OzGav OzGav added this to the 2.10.0 milestone May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-stable bugfix dependencies-reviewed Indication that any added or modified/updated dependencies on a PR have been reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bandcamp: Artist search returns label/store as artist

4 participants