Seeding Recordings

I recently found the capabilities to Seed in releases, which some of the user-scripts tend to use when importing from other sources.

I have been looking over the functionality and want to tackle the seeding of recordings from OverClocked ReMix.
Upon initial investigation, the 'Add Recordings" has very basic support for injecting core recording data using the “edit-recording” attribute. By playing around with the GET directives, the following elements were are supported.

edit-recording
 - name
 - length
 - artist_credit.names[x]
 - irscs[x]
 - comment

artist (with MBID)

Based on this, are there plans to extend the Seeding for recordings, how can the other elements be passes, and would it be possible to submit a User Script that can scrape the OC Remix recordings, and have relationships added to them, much like the recordings in the OC Remix Series?
https://beta.musicbrainz.org/series/b2b031ec-176e-45fd-8965-4691a9e79691

4 Likes

You can also seed the “video” flag, relationships and URLs. Is there anything missing?

I wouldn’t say anything missing. Maybe some documentation for this. Cause I am unsure on how to trigger the other details.

For URLs, I tried mimicking the key, value pairs from the Release seed, and it did work for the Recording seed.

A description of how to seed general relationships is at https://bitbucket.org/metabrainz/musicbrainz-server/pull-requests/1393

2 Likes

Thanks for the link! It’s really help.

I’ve designed a simple script that scrapes the data from the page and prepares it. I works well when sending a GET request by populating the field. Sending a POST request seems to create a full record. (Best to avoid that).

I need some clarification about one of the attributes. I have populated the record with Recording-Series relationship, and need to inject the ID of the track into the attribute, but it fails to be parsed.
Using “rels.x.butterfat.y.number” or “rels.x.attribute.number” both fail.

Why is this?

Here is a test link: OC ReMix: 3-D Ultra Pinball: Creep Night “Welcome to Our Castle” as a recording entry

You aren’t following the format. Your example link contains this: rels.0.attributes.number=OCR03044 First, there may be multiple attributes on a relationship, so they need to be numbered. Second, the key for the attribute content isn’t number, but text_value. So rels.0.attributes.0.text_value=OCR03044 would be closer. However, you also need to specify the attribute type via ...0.type.

Is there not any documentation on attribute type ID’s

You can open an editor, choose your relationship and click the help button, that will show you its UUID.
You can see its numeric ID in the <select> code itself, IIRC, but anyway it’s the other one you need (the UUID).

I’m using the UUID to pick out the “Part of Series” relationship, but I am struggling to trigger the “Number” attribute for this relationship.

It’s a59c5830-5ec7-38fe-9a21-c7ea54f6650a.

1 Like

Sadly, that failed… :disappointed:

I’m reviving this old thread because I’m also having trouble seeding the Add Standalone Recording form.

I’m able to seed most of the fields that I care about using the parameters discussed above:

  • artist
  • edit-recording.artist_credit.names.0.name
  • edit-recording.name
  • edit-recording.length
  • edit-recording.edit_note

However, I haven’t had any luck figuring out how to seed an external URL with the “download for free” relationship.

I first tried using urls.0.url and urls.0.link_type as described in the Development/Release Editor Seeding documentation.

Next, I tried prefixing those parameter names with edit-recording. since that seems to be needed for the non-artist parameters. (Why is artist different?)

I also tried rels.0.target and rels.0.type, rels.0.attributes.0.text_value and rels.0.attributes.0.type, and those pairs with edit-recording. prefixes.

In all of those cases, the “Relationships” and “External Links” sections remain empty, though.

I looked through the issue tracker but didn’t find anything relevant (besides [MBS-12287] Allow seeding URL relationship attributes - MetaBrainz JIRA, maybe). I haven’t poked around the server before, but I couldn’t find any code in https://github.com/metabrainz/musicbrainz-server that was seeding URLs for standalone recordings (Recording/Edit.pm appears to seed various other fields, though).

What am I doing wrong?

2 Likes

In case it helps anyone else, I finally figured out how to seed URL relationships for standalone recordings!

The relevant GET query parameters are e.g. edit-recording.url.0.text and edit-recording.url.0.link_type_id.

I found the names in a regular expression in root/static/scripts/edit/externalLinks.js:

      // Terribly get seeded URLs
      if (MB.formWasPosted) {
        // [omitted]
      } else {
        const seededLinkRegex = new RegExp(
          '(?:\\?|&)edit-' + sourceType +
            '\\.url\\.([0-9]+)\\.(text|link_type_id)=([^&]+)',
          'g',
        );
5 Likes