Fetching ISRCs from Spotify

We really need edit notes on Add ISRCs edits!

2 Likes

I’m still going back and just copying the new URL. Hope that’s good enough. But yes, I have to go back and do that.

1 Like

That’s very good :+1: but I see many other ISRC edits without notes (even from some editors I keep telling them).
And when we don’t know for what release it was added and from what source, it’s then difficult to trust them and to later fix or merge with no mistakes.

4 Likes

This tool is really neat. Just an odd observation: after submitting the edit to MusicBrainz, the app gives me a 0 byte randomly named file to download. Not sure why that happens. This is on Firefox, if that matters.

Yeah the MB server sends that. I can’t do much about it except look at moving to the newer API, which is roughly on the roadmap but only for the same reason as you suggest: the “download” files are annoying to cleanup all the time.

Another thing I noticed is that the MusicBrainz API expects ISRCs to always be uppercase, but Spotify doesn’t always return them that way (example). This results in an invalid ISRC error upon submission.

I’ve been using a quick JS hack to uppercase them before submitting:

(function() {
    var a = document.forms[1].getElementsByTagName('input')
    for (var i = 0; i < a.length; i++) {
        if (a[i].type == 'hidden') {
            a[i].value = a[i].value.toUpperCase();
        }
    }
})();

Pop that into the console, or a userscript, and smooth sailing from there.

Note: This doesn’t attempt to fix the ISRC anywhere else on the page, just the hidden form inputs. It also uppercases the entire input, including MBID, but a GUID is a GUID so MB doesn’t complain.

This should now be patched. Do you have any examples of albums with lowercase ISRCs, out of curiosity?

Besides the one linked above, pretty much every album by The Cog is Dead is returning lowercase ISRCs. Some of those albums don’t exist on MB yet, so I can’t test the patch at the moment.

Actually, the server ignores duplicate ISRC edits, so I just tried it, and I got a successful response.

Also, the ISRC in the form field is now uppercase, but the ISRC URL next to each entry is still lowercase, and returns “ISRC not currently used” when clicked. Perhaps the proper solution would be to file a bug with MB to treat ISRC as case insensitive?

Only the form submission is patched. Lookup and display remain the same.

I agree that it’s silly that a data type that is case insensitive according to its own standard is looked up in a case sensitive manner by MB (particularly since entering them by hand on recording pages has logic to handle this) but in the meantime I’ll patch again to convert ISRCs to upper case before they are used anywhere, for better consistency.

2 Likes

And now the latest bit of weirdness: The Vice Quadrant: A Space Opera - an album in two parts. On MB, it is listed as a single two-medium release, but on Spotify, it is two separate albums (Part 1 and Part 2).

Part 1 entered just fine into the tool, and populated the first medium. Part 2, however, not so much. It would seem that the tool only pulls and displays the first medium in a multi-disc release. Even were that fixed, in this case, it would still need to accept multiple Spotify album IDs to work correctly in this situation.

Or to just uppercase on paste. Either way, yes, please do :slight_smile:

@reosarevok what component should that be filed under then?

MBS project, Editing Interface component, IMO.

@reosarevok Done: MBS-9881.

2 Likes

That’s not correct.

It shows all mediums for a given release, but it shows only as many tracks as the Spotify release has – the idea isn’t to show all the information in one place, it’s to create the edit for you, so where the Spotify release has 4 tracks, but the MB one has 9, there’s no point showing any more than 4, because it’s only able to create an edit for those 4.

Combining Spotify releases in this way is doable as though they’re one big release but non-trivial for various reasons, and also would increase the chance of bad edits. This is a case of “no plan to fix” for now, particularly because it’s an edge case and not quite in keeping with the goal of the tool – if Spotify considers two discs to be separate releases, then technically it’s no longer a 1-to-1 with the one in MB, which is all this really tries to help with.

Moreover, in this instance, I don’t see why you wouldn’t just do it by adding the two separate parts as releases on MB first – they have both been assigned separate UPCs for the digital versions, ergo they have been released as separate entities.

If this script is clever enough to do all the lookups to grab all these ISRCs from Spotify, why does it not also ask the user to type in one line of comment to put into the edit. OR start with a default comment of “Uploaded by the Tatsumo Spotify IRSC tool”. It then lets me know what I am seeing on my subscribed edits.

Because the server doesn’t support this, as is already mentioned above.

Sorry - haven’t been following the whole thread. Using Scripts is in my “ToDo” list, so I have not yet read up or fully understand them yet.

You’re right of course. I wasn’t paying enough attention to that. The separate relesases have been added now.

Does anyone know if the UPCs that Spotify reports are unique to the digital releases, or are they shared with the corresponding physical releases (if existing)? I think they are unique, but I want to be certain.

This is related to edit #57143089.