Skip to content

"View on Discogs" link for an album 404s — internal ID-routing tag leaks into the public URL #1203

Description

@RiceTeaPrince

Summary

Clicking "View on Discogs" for an album opens a 404. Example (artist: Naoya Matsuoka, album: Watermelon Dandies, Discogs release ID 5743831):

  • Broken link shown: https://www.discogs.com/release/r5743831
  • Correct link: https://www.discogs.com/release/5743831 (Discogs redirects a bare numeric release ID to its canonical slugged URL, so the slug isn't required — confirmed by manually removing the leading r, which alone made the link resolve)

Root cause

The stray leading r is SoulSync's own internal ID-routing tag (core/discogs_client.py's _tag_discogs_album_id, added in #848 to fix the master/release collision in #847) leaking into a public-facing field. It's meant to stay an internal detail for _discogs_album_endpoints() routing between /masters/{id} and /releases/{id}, but leaks out through two independent paths:

  1. The artist-detail discography grid_build_artist_detail_release_card() (core/metadata/discography.py) never includes external_urls in its output, even though Album.from_discogs_release() already computes the correct, fully-slugged URL from Discogs' own uri field at parse time. The card is left with only the tagged id.
  2. The persisted albums.discogs_id DB column — the background auto-match worker (core/discogs_worker.py's _update_album()) writes the tagged id straight into the database. It's read back verbatim (no un-tagging) by get_artist_full_detail() and handed to the frontend, where getServiceUrl() does a plain string interpolation with no idea the tag exists. This is the one that fires for an already-matched library album's "View on Discogs" badge, not just an unowned discography-grid card.

Steps to reproduce

  1. Use Discogs as (or one of) the metadata source(s).
  2. Open an artist whose album has been auto-matched to Discogs, or browse an artist's Discogs discography grid.
  3. Click "View on Discogs" on an album.

Expected: the real Discogs release page loads.
Actual: 404 — the URL has a stray r (or m, for a master release) prefixed to the numeric ID.

Impact

Any album sourced from or matched against Discogs whose "View on Discogs" link a user clicks — both the discography-browsing view and an already-matched library album's badge.

I have a fix (verified against real Discogs API data, plus new regression tests) and will open a PR against dev referencing this issue. Thanks for SoulSync!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions