derat/yambs

Support seeding recording relationships

Closed this issue · 3 comments

derat commented

https://musicbrainz.org/recording/create has a (complicated) "Relationships" section, but I haven't figured out how to seed it yet (or if it's even possible to seed it). There's already separate functionality for seeding URL relationships.

The notes at https://bitbucket.org/metabrainz/musicbrainz-server/pull-requests/1393 (MBS-7913) should help you to implement relationship seeding. Apparently it's possible for all entity types except for releases (for which the editor doesn't share the same codebase).

P.S. In case you decide to implement this, I would love to have support for seeding works (which would be pointless without being able to seed writer relationships).

derat commented

Thanks, I had seen that change via https://community.metabrainz.org/t/seeding-recordings/188972, but I think I had trouble getting it to work. (Just as a note to myself, the code added by that change looks like it was replaced in 2021 by metabrainz/musicbrainz-server@6884105 (MBS-11985).)

After some more experimentation now, I finally got it working with the URL https://test.musicbrainz.org/recording/create?edit-recording.name=Test+Recording&rels.0.target=3f82ca05-977f-4f73-806e-4dd0037eab19&rels.0.type=5dcc52af-7064-4051-8d62-7d80f4c3c907 -- maybe I'd used incompatible combinations of entities and link types earlier.

I'll try to get this working now; thanks for the nudge to look at it again. :-) I'll probably also generate mappings from link types to MBIDs so that it will be possible to specify types as the integer IDs from the database instead of requiring the full UUIDs.

Oh, and I'm happy to add support for seeding works too if it'd be helpful. I'll file a separate bug to track that.

derat commented

Additional note to self: rels.X.type parameters look like they accept either database IDs or UUIDs (e.g. 138 and 5dcc52af-7064-4051-8d62-7d80f4c3c907 both add an "engineer" relationship), so I probably don't need to generate new link type mappings.