Script for renaming all relationships

hello! i’m wondering if there’s a script to add “credited as” to every relationship of an entity? recently the staples center arena renamed themselves to the arena. unfortunately, the place has over 200 performances and we’ll now have to rename all of them. i’m wondering if there’s a way to get this done faster?


I don’t think so. And this is why I think the “credited as” box should be filled in by default.

Sadly, MBS-10056 ignores the fact that names can change in the future.


There must be a better way. This isn’t the first time it has happened.

If you merge two places up pops the box offering the Credited As for loosing side of the merge. I thought that happened on a rename?

It’s only for artists that we can edit artist credit, in the Aliases tab.

:warning: But I think it only edits the original artist credits (recordings, tracks, releases and release groups), not the more recent artist credit on relationships.

We are lacking two things:

  • Make Edit artist credit change the relationships, as well
  • Make the Edit artist credit (I should say Credited as because it can also be instruments and vocals, credited as…) available on all entities

There are no tickets about these 2 issues (I thought there was but I didn’t find).

@sammyrayy, I didn’t really understand your exact problem with place credit after merge?
It’s it same problem as this below ticket, maybe (I don’t remember its content either exactly)?

Why rename the credit for relationships that existed during the time it was called the Staples Center Arena?

1 Like

If you know how to use the console/developer tools in your web browser, you could execute that block of code on the “Edit relationships” page:

  rec => {
      rel => rel.linkTypeID() === 693 && 
      rel.entities()[0].gid === 'ec64d551-7a36-48ca-960a-ac6c08dcdb6e'
      rel => rel.entity0_credit('Staples Center')

That will add/replace the “credited as” to “Staples Center” for all “recorded at” relations of all selected recordings to this specific place


i want to rename them to “staples center arena”. the name of the place is being changed and with it, every single relationship, too.


Yes, but not retroactively? If you see an old poster for a concert there, has the name of the venue magically changed on it? Do we rename artist credits on older releases if an artist later changes its name?

1 Like

I think there is a misunderstanding between you two :slight_smile: As I understand it the goal is to explicitly set the credits for old relationships to “Staples Center Arena” ( the old name) so they don’t appear as “ Arena”.


I think Sammy is pointing out that if the place “credited as” is blank that when a place gets a name change, it changes all the places on relationships to the new name. Just wants a quick way of making sure the old name sticks. Not sure that’s possible, unfortunately. I’ve had to redo labels & places like this. It’s unnecessarily time consuming and should be just like it is for artist that it automatically keeps the old name.

Update: I’m definitely bookmarking the loujin script above for next time I run across it. Did it work out?


well… i tried it a few times and it didn’t make any changes. i don’t use scripts like this a lot, though, so i’m 99% sure i just did it wrong lol. i’ll give it another shot tomorrow.


Now I understand better. That makes a lot more sense!

The easiest way I can see for editing the recordings is to hope there’s a bunch of them attached to a release and edit them from there, like so:

I’ve successfully tested this on