Harmony: Music Metadata Aggregator and MusicBrainz Importer

Thank you for reminding me again, I’ve finally entered a ticket for this:

I was just about to tag it as good-first-issue and submit, when it occurred to me that this could be the starting point of modelling release relationships in Harmony :sweat_smile:

P.S. While reminders and tickets are always welcome, I am also keeping the email notifications for all posts I haven’t replied to as a safety net (tasks to be done some other day).

5 Likes

Not sure I understand how Harmony decides to map something to an MB Artist. There are dozens of separate artists named some variation of “Oktober” which are incorrectly merged in Deezer and Apple Music, so multiple MB Artists are linked to the shared page. They are all getting mapped to the German band by Harmony:

I’d expect that if Harmony isn’t sure which MB Artist it is, that no Artist MBID is seeded to the release editor.

On other platforms (e.g., Tidal and Spotify), some of the artists listed above have cleaner/separate profile pages or are a different mix of incorrectly merged artists.

2 Likes

Harmony ignores all links which are associated with multiple artists.
But there is also a Spotify link which is exclusively linked to the German band, so I guess that one is picked up and mapped. Hard to tell without a release lookup example where mapping fails.

There is one annoying scenario that could happen though: Once Harmony has found a unique mapping, it will cache it and adding the same link to more artists won’t help immediately: Wrong MBID mapping for ambiguous artist names · Issue #68 · kellnerd/harmony · GitHub

1 Like

It’s probably this then.

I have tested this Harmony importer with mb_PREFERRED-MBS, set up to prefer musicbrainz.eu, and surprise! it worked!

var preferred_mbs = "https://musicbrainz.eu";
3 Likes

Very minor issue

TL;DR
Harmony’s release type detection can fall short for EPs with titles like “Down Under EP Vol 1” when no provider thinks it’s an EP and the title doesn’t end with “EP”

https://harmony.pulsewidth.org.uk/release?beatport=5290432&spotify=2BvTnnBYLzd5Qd1VRk7IBC&gtin=663918457177&deezer=&region=US&ts=1756579182

Long version generated by AI

Analysis of Release Type Classification for “Down Under EP Vol 1”

1. Observation

The release titled “Down Under EP Vol 1” was expected to be classified as an EP due to the presence of “EP” in its title. However, the Harmony application ultimately classified it as a Single. This report details the technical reasons for this outcome based on an analysis of the Harmony source code.

2. Findings

The classification is the result of two key mechanisms in Harmony’s logic: the specificity of its title-parsing rules and its process for merging conflicting data from different music providers.

2.1. Specificity of the Title Guessing Logic

Harmony attempts to guess a release’s type by matching its title against a set of predefined regular expressions. This logic is located in harmonizer/release_types.ts .

The specific pattern used to detect a generic EP is as follows:

/\s(EP)(?:\s\(.*?\))?$/i,

The critical component here is the $ at the end of the expression. This is a special character in regular expressions that anchors the pattern to the end of the string .

Because the title “Down Under EP Vol 1” has " Vol 1" after “EP”, it does not match this pattern. As the term “EP” is not at the very end of the title, the title analysis does not contribute “EP” as a possible release type.

2.2. Provider Data Conflict Resolution

Since the title analysis did not return “EP” as a type, Harmony fell back to the data provided by the music services. According to the “Alternative Values” section on the release page, Harmony received conflicting information:

  • Spotify classified the release as a Single .
  • Deezer classified the release as an Album .

To resolve these conflicts, Harmony uses a merging function, reducePrimaryTypes , also found in harmonizer/release_types.ts . This function establishes a clear hierarchy for release types.

if (previous == 'Album' || previous == 'Other') {
	// Prefer more specific types over Album or Other. Many providers use Album
	// as the generic type.
  return current;
}

This logic dictates that a more specific type like Single will always be preferred over a generic type like Album . Consequently, when merging the data from Spotify and Deezer, “Single” was chosen as the definitive type for the release.

3. Conclusion

The classification of “Down Under EP Vol 1” as a Single is the correct and expected behavior according to Harmony’s current codebase. The title-based detection did not match due to a specific regular expression pattern, and the subsequent merging logic correctly prioritized the more specific Single type provided by Spotify over the more generic Album type from Deezer. This illustrates an edge case where the current heuristics may not capture every possible title variation for EPs.

Shameless plug

I also released an updated version of my Harmony enhancements script that looks for “EP” not only at the end of the release title

3 Likes

As of today, TIDAL import no longer works. I get the following error message:

Tidal: copyright.replace is not a function

2 Likes

confirmed the above, and when looking up a TIDAL link it throws two errors

image

1 Like

Thank you for reporting, this was caused by another breaking API change:

Fortunately easy to be fixed but still annoying that they never announce such changes :angry:

7 Likes

A little suggestion for the release actions page: It would be nice if Harmony can recognize potential duplicates for Apple Music links that only differ by country code before generating URLs to be seeded.
Right now we’re getting plenty of cases (especially on artist pages) where editors not checking what’s already linked are seeding the same link for as many countries as imaginable and I’ve been trying to correct them wherever I find them.

6 Likes

There is an existing ticket for that in the Harmony issues btw :slight_smile:

5 Likes

FYI, Spotify Search API is broken: Search API ignoring market parameter - The Spotify Community

2 Likes

Any idea why this beatport release reports the wrong tracklist? happens with Harmony and the beatport importer script
eg. on beatport, track 1 is “Welcome”, but Harmony and the importer show “Royal Beluga” as the first track.

Probably not an issue of Harmony specifically

1 Like

Sigh… Unfortunately I currently have no time to look into this. Does this cause any wrong data to be combined with other sources or does it “only” have implications on which region’s releases can be looked up (by barcode, I assume)?

Looks like this issue:

Thank you for your example, it was helpful to confirm my theory. Unfortunately that doesn’t help me to fix the issue, I have no idea how to do that yet.

6 Likes

I’m not sure if this issue has already been reported but for some reason Harmony doesn’t understand how to lookup albums that have multiple discs and it’s the same for all 4 major streaming services (Spotify, Apple Music, Tidal and Deezer) but the issue will be fixed if you exclude iTunes then the other streaming services with multiple disc lookup as usual.

I thought perhaps this is iTunes issue but a‐tisket doesn’t have this issue.

1 Like

Weird. I’ve never had that issue. I use it for all 4 all the time.

There seems to be a bug with the entity resolving for Bandcamp
https://harmony.pulsewidth.org.uk/release?bandcamp=chainedvision%2Fdfh-sound-of-underworld-cv061&ts=1758458004

1d30f911-8b6f-45f5-8e42-28f1c02083da is set as the artist MBID but it’s actually a label

The URL of the Bandcamp profile also links to the label

It seems to be exactly as I had assumed:

Thanks, that is a side-effect of the new batch lookup of URLs. But it also gives us the opportunity to improve the decision heuristics whether the band account is a label or an artist instead of just not resolving an MBID:

Can you please give an example?

2 Likes

For this release Harmony shows no tracklist
https://harmony.pulsewidth.org.uk/release?spotify=3wUiLigk9OOrvYfk4eRII5&ts=1759042560

I copied the Spotify album URL and looked it up again, and it worked.