Skip to content

fix(bandcamp): write MusicBrainz track ids where Lidarr 4.0 keeps them - #259

Merged
chodeus merged 1 commit into
mainfrom
fix/lidarr-4-track-ids
Nov 18, 2026
Merged

chodeus merged 1 commit into
mainfrom
fix/lidarr-4-track-ids

Conversation

@chodeus

@chodeus chodeus commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner
  • Lidarr 4.0 (upstream develop, .NET 10) dropped AudioTag.MusicBrainzReleaseTrackId, and its MusicBrainzTrackId now holds the release track id, with the recording in the new MusicBrainzRecordingId. Bandcamp retagging named the dropped property, so on 4.0 every file failed with MissingMethodException and kept the store's tags. That failure was logged only at Debug.
  • MusicBrainzTrackIds.Set writes both ids to whichever properties the running Lidarr has, so one net8.0 build loads and tags correctly on the current plugins branch and on 4.0. If neither shape is there, it warns once and the rest of the retag still runs.
  • A failed retag now logs one Warn per download with a count, and each file's error stays at Debug.
  • Pre-import read-back reads the recording through the plugin's merged TagLib 2.2, which is safe on 4.0. Its tests now write the recording by frame name (MUSICBRAINZ_TRACKID), so a later TagLib 2.5 bump fails them and can't slip through.
  • Checked on real 4.0 builds (upstream develop ddf8080 and a fork build): plugincheck reports compatible, and Bandcamp retagging writes recording and release track ids that read back right in mp3, flac, m4a, opus, ape, wma and mp2.

Summary by CodeRabbit

  • Bug Fixes
    • MusicBrainz recording and release-track IDs are now saved to the appropriate audio tags across supported Lidarr versions, helping preserve accurate track metadata.
    • Bandcamp downloads continue processing when metadata updates fail for individual files, with a summary warning reporting how many files were affected.

@chodeus chodeus added the release:patch Merge to main → patch release label Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds property-shape-aware MusicBrainz ID assignment and uses it during Bandcamp metadata normalization. It also aggregates normalization failure reporting and updates tests for ID assignment and FLAC comment fields.

Changes: MusicBrainz ID compatibility

Layer / File(s) Summary
ID mapping and validation
src/Sleezer/Core/Utilities/MusicBrainzTrackIds.cs, src/Sleezer/Core/PostProcessing/PreImportTagger.cs, tests/Sleezer.Tests/MusicBrainzTrackIdsTests.cs, tests/Sleezer.Tests/Sleezer.Tests.csproj
MusicBrainzTrackIds.Set selects supported string properties to assign recording and release-track IDs. Missing IDs preserve existing values, and unsupported property shapes remain unchanged. Tests cover both property shapes, unsupported shapes, and a FLAC round trip.
Bandcamp normalization integration
src/Sleezer/Download/Clients/Bandcamp/BandcampDownloadProxy.cs, tests/Sleezer.Tests/PreImportTaggerWholeDownloadTests.cs
Bandcamp uses the helper to assign both IDs. It records per-file normalization failures and logs a warning with the failed and total file counts after processing. The related test writes the recording ID to the MUSICBRAINZ_TRACKID comment field.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BandcampDownloadProxy
  participant MusicBrainzTrackIds
  participant AudioTag
  BandcampDownloadProxy->>MusicBrainzTrackIds: Set(tag, recordingId, releaseTrackId)
  MusicBrainzTrackIds->>AudioTag: Inspect supported string properties
  MusicBrainzTrackIds->>AudioTag: Assign IDs to matching properties
Loading
Merge Risk: Minimal · up to 52247

This change makes Bandcamp retagging write MusicBrainz track and recording IDs correctly on both older Lidarr and Lidarr 4.0. No merge-blocking issue was found in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Bandcamp downloads now write MusicBrainz track IDs to the properties that Lidarr 4.0 uses. The changeset adds MusicBrainzTrackIds.Set, which picks the available proper…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Bandcamp downloads now write MusicBrainz track IDs to the properties that Lidarr 4.0 uses. The changeset adds MusicBrainzTrackIds.Set, which picks the available property shape, and updates BandcampDownloadProxy and PreImportTagger to match. The title is specific and scoped to the primary fix, and it follows conventional-commit style.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d55405e and 5224723.

Files selected for processing: 6

  • src/Sleezer/Core/PostProcessing/PreImportTagger.cs
  • src/Sleezer/Core/Utilities/MusicBrainzTrackIds.cs
  • src/Sleezer/Download/Clients/Bandcamp/BandcampDownloadProxy.cs
  • tests/Sleezer.Tests/MusicBrainzTrackIdsTests.cs
  • tests/Sleezer.Tests/PreImportTaggerWholeDownloadTests.cs
  • tests/Sleezer.Tests/Sleezer.Tests.csproj

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@chodeus
chodeus merged commit 87b3d9c into main Nov 18, 2026
5 checks passed
@chodeus
chodeus deleted the fix/lidarr-4-track-ids branch November 18, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Merge to main → patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant