# Seeding Recordings

**URL:** https://community.metabrainz.org/t/seeding-recordings/188972
**Category:** Development
**Tags:** userscripts, recording, musicbrainz
**Created:** [January 4, 2017, 6:46am UTC](https://community.metabrainz.org/t/seeding-recordings/188972 "2017-01-04T06:46:01Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Jimmyson](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jimmyson/32/4842_2.png) [@Jimmyson](https://community.metabrainz.org/u/Jimmyson)
#### Post date: [January 4, 2017, 6:46am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/1 "2017-01-04T06:46:01Z")

</div>

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](https://beta.musicbrainz.org/series/b2b031ec-176e-45fd-8965-4691a9e79691)

---

<div class="post-metadata">

### Author: ![chirlu](https://community.metabrainz.org/user_avatar/community.metabrainz.org/chirlu/32/45_2.png) [@chirlu](https://community.metabrainz.org/u/chirlu)
#### Post date: [January 4, 2017, 8:44am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/2 "2017-01-04T08:44:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jimmyson](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jimmyson/32/4842_2.png) [@Jimmyson](https://community.metabrainz.org/u/Jimmyson)
#### Post date: [January 4, 2017, 9:09am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/3 "2017-01-04T09:09:21Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![chirlu](https://community.metabrainz.org/user_avatar/community.metabrainz.org/chirlu/32/45_2.png) [@chirlu](https://community.metabrainz.org/u/chirlu)
#### Post date: [January 4, 2017, 9:35am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/4 "2017-01-04T09:35:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jimmyson](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jimmyson/32/4842_2.png) [@Jimmyson](https://community.metabrainz.org/u/Jimmyson)
#### Post date: [January 5, 2017, 5:56am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/5 "2017-01-05T05:56:52Z")

</div>

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](https://musicbrainz.org/recording/create?edit-recording.name=3-D+Ultra+Pinball%3A+Creep+Night+%22Welcome+to+Our+Castle%22+OC+ReMix&edit-recording.length=4%3A15&edit-recording.artist_credit.names.0.name=Chernabogue&edit-recording.artist_credit.names.0.artist.name=Chernabogue&edit-recording.artist_credit.names.0.artist.id=1&edit-recording.url.0.text=http%3A%2F%2Focremix.org%2Fremix%2FOCR03044&edit-recording.url.0.link_type_id=306&rels.0.target=b2b031ec-176e-45fd-8965-4691a9e79691&rels.0.type=ea6f0698-6782-30d6-b16d-293081b66774&rels.0.attributes.number=OCR03044&edit-recording.edit_note=Recording+scraped+from+OverClocked+ReMix+%28http%3A%2F%2Focremix.org%2Fremix%2FOCR03044%29+using+the+OC+ReMix+import+script)

---

<div class="post-metadata">

### Author: ![chirlu](https://community.metabrainz.org/user_avatar/community.metabrainz.org/chirlu/32/45_2.png) [@chirlu](https://community.metabrainz.org/u/chirlu)
#### Post date: [January 5, 2017, 6:32am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/6 "2017-01-05T06:32:40Z")

</div>

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`.

---

<div class="post-metadata">

### Author: ![Jimmyson](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jimmyson/32/4842_2.png) [@Jimmyson](https://community.metabrainz.org/u/Jimmyson)
#### Post date: [January 5, 2017, 9:15am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/7 "2017-01-05T09:15:17Z")

</div>

> [@chirlu](#):
>
> However, you also need to specify the attribute type via …0.type.

Is there not any documentation on attribute type ID’s

---

<div class="post-metadata">

### Author: ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)
#### Post date: [January 5, 2017, 9:21am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/8 "2017-01-05T09:21:37Z")

</div>

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** ).

---

<div class="post-metadata">

### Author: ![Jimmyson](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jimmyson/32/4842_2.png) [@Jimmyson](https://community.metabrainz.org/u/Jimmyson)
#### Post date: [January 5, 2017, 9:23am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/9 "2017-01-05T09:23:56Z")

</div>

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.

[![](http://i.imgur.com/DhMcHVp.png) ](http://i.imgur.com/DhMcHVp.png)

---

<div class="post-metadata">

### Author: ![chirlu](https://community.metabrainz.org/user_avatar/community.metabrainz.org/chirlu/32/45_2.png) [@chirlu](https://community.metabrainz.org/u/chirlu)
#### Post date: [January 5, 2017, 11:40am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/10 "2017-01-05T11:40:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jimmyson](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jimmyson/32/4842_2.png) [@Jimmyson](https://community.metabrainz.org/u/Jimmyson)
#### Post date: [January 6, 2017, 5:10am UTC](https://community.metabrainz.org/t/seeding-recordings/188972/11 "2017-01-06T05:10:17Z")

</div>

Sadly, that failed… 😞

---

<div class="post-metadata">

### Author: ![derat](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/d/71c47a/32.png) [@derat](https://community.metabrainz.org/u/derat)
#### Post date: [September 24, 2022, 1:22pm UTC](https://community.metabrainz.org/t/seeding-recordings/188972/12 "2022-09-24T13:22:04Z")

</div>

I’m reviving this old thread because I’m also having trouble seeding the [Add Standalone Recording](https://musicbrainz.org/recording/create) 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](https://wiki.musicbrainz.org/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 [https://tickets.metabrainz.org/browse/MBS-12287](https://tickets.metabrainz.org/browse/MBS-12287), maybe). I haven’t poked around the server before, but I couldn’t find any code in [https://github.com/metabrainz/musicbrainz-server](https://github.com/metabrainz/musicbrainz-server) that was seeding URLs for standalone recordings ([Recording/Edit.pm](https://github.com/metabrainz/musicbrainz-server/blob/e9914f42c2203682a3c7c4146bf44feaa3fca4a8/t/lib/t/MusicBrainz/Server/Controller/Recording/Edit.pm) appears to seed various other fields, though).

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![derat](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/d/71c47a/32.png) [@derat](https://community.metabrainz.org/u/derat)
#### Post date: [November 7, 2022, 12:02pm UTC](https://community.metabrainz.org/t/seeding-recordings/188972/13 "2022-11-07T12:02:25Z")

</div>

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](https://github.com/metabrainz/musicbrainz-server/blob/master/root/static/scripts/edit/externalLinks.js):

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

```
