# Userscript to add and import voice actor credits

**URL:** https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766
**Category:** MusicBrainz
**Tags:** userscripts, audiodrama, relationships
**Created:** [January 6, 2022, 4:53pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766 "2022-01-06T16:53:39Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![kellnerd](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kellnerd/32/66963_2.png) [@kellnerd](https://community.metabrainz.org/u/kellnerd)
#### Post date: [January 6, 2022, 4:53pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/1 "2022-01-06T16:53:39Z")

</div>

Discussion and support thread for my new userscript:

## Voice Actor Credits

[![Install](https://img.shields.io/badge/Install-success.svg?style=for-the-badge&logo=tampermonkey)](https://github.com/kellnerd/musicbrainz-bookmarklets/blob/main/dist/voiceActorCredits.user.js?raw=1) [![Source](https://img.shields.io/badge/Source-grey.svg?style=for-the-badge&logo=github)](https://github.com/kellnerd/musicbrainz-bookmarklets/blob/main/dist/voiceActorCredits.user.js)

- Simplifies the addition of “spoken vocals” relationships (at release level) by providing a pre-filled dialogue in the relationship editor.
- Imports voice actor credits from linked Discogs pages.
- Automatically matches artists whose Discogs pages are linked to MB (unlinked artists can be selected from the already opened inline search).
- Caches Discogs to MBID mappings (to reduce API calls) and collects mappings for freshly matched artists (which were chosen by the user)
- Shows links to seed artist edit pages with the Discogs URLs for these new matches.

---

<div class="post-metadata">

### Author: ![IvanDobsky](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ivandobsky/32/11785_2.png) [@IvanDobsky](https://community.metabrainz.org/u/IvanDobsky)
#### Post date: [January 6, 2022, 5:35pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/2 "2022-01-06T17:35:15Z")

</div>

That “install” button doesn’t do anything on my Greasmonkey \ Vivaldi setup. Source is also a duff button. Can you supply linkies?

---

<div class="post-metadata">

### Author: ![kellnerd](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kellnerd/32/66963_2.png) [@kellnerd](https://community.metabrainz.org/u/kellnerd)
#### Post date: [January 6, 2022, 5:39pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/3 "2022-01-06T17:39:10Z")

</div>

Sorry for that, I had explicitly copied these image links from my README on GitHub to be sure to make no mistakes, but I forgot that these are relative links 😂  
They should work now, I have converted them into absolute links. Thanks for the hint.

---

<div class="post-metadata">

### Author: ![IvanDobsky](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ivandobsky/32/11785_2.png) [@IvanDobsky](https://community.metabrainz.org/u/IvanDobsky)
#### Post date: [January 6, 2022, 5:53pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/4 "2022-01-06T17:53:19Z")

</div>

My browser monkey says it works now. I am a good tester who can break anything. 😂

---

<div class="post-metadata">

### Author: ![aerozol](https://community.metabrainz.org/user_avatar/community.metabrainz.org/aerozol/32/116_2.png) [@aerozol](https://community.metabrainz.org/u/aerozol)
#### Post date: [January 6, 2022, 8:47pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/5 "2022-01-06T20:47:07Z")

</div>

![image](https://community.metabrainz.org/uploads/default/original/3X/3/b/3bd4d97db1e9a5cac01c1fa2253bf6ddcaa34083.png)

…thank you soooooooo much 😁

---

<div class="post-metadata">

### Author: ![kellnerd](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kellnerd/32/66963_2.png) [@kellnerd](https://community.metabrainz.org/u/kellnerd)
#### Post date: [January 11, 2023, 9:10pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/6 "2023-01-11T21:10:13Z")

</div>

It’s been a long time since I had announced any new userscript features in this thread, so I’m going to do that today:

## Parse voice actor credits from text

In addition to importing voice actors from Discogs, you can also parse them from almost any text source now. Actually, this feature has been available for months, but I haven’t seen anyone (besides me) using it yet.  
Below are a few example lines which work out of the box:

```plaintext
Sherlock Holmes: Clive Merrison
Narrator - John Doe
Women at the Station	Jane Doe

```

Using the advanced configuration option _Credit separator_, the parser can deal with any kind of separator, as long as each line contains the name of the actor and the name of their role. Actors and roles can also be in reverse order, simply hold SHIFT while clicking the button to swap them.

Once you’ve matched an artist entity for a given artist name the first time, the script remembers that and will no longer ask you to select an artist again. That probably sounds familiar to the users of my copyright parser script, both scripts share the same mapping cache and the UI:

 ![image](https://community.metabrainz.org/uploads/default/original/3X/3/7/370d4484b2bf7ae43dc65cfc3e2624267e2e4cc6.png)

## Support for the new releationship editor

For those who are/were already testing the new [React relationship editor](https://tickets.metabrainz.org/browse/MBS-11847) on the beta server, I’ve released a new version (of the userscript) today which also supports the beta server (in addition to the old relationship editor on the regular production servers). The new code is basically an almost complete rewrite as a lot of internals of the new relationship editor work differently, so feel free to test it.

Without the help of @Bitmap, who has implemented almost all the “userscript backdoors” in MBS for which I had asked (e.g. exposing the functions to create relationship dialogs), porting the userscript would not have been possible at all. Thanks a lot!

---

<div class="post-metadata">

### Author: ![vzell](https://community.metabrainz.org/user_avatar/community.metabrainz.org/vzell/32/752_2.png) [@vzell](https://community.metabrainz.org/u/vzell)
#### Post date: [October 28, 2023, 3:13pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/7 "2023-10-28T15:13:34Z")

</div>

Hi @kellnerd

Is it possible to extend this script for importing other release level relationships from Discogs … as the basic functionality seems to be there already ?

I used to use the following userscript from [mattgoldspink](https://github.com/mattgoldspink) - [https://github.com/mattgoldspink/musicbrainz-userscripts/blob/feature\_fix\_always\_render\_button/import-relationships-from-discogs.user.js](https://github.com/mattgoldspink/musicbrainz-userscripts/blob/feature_fix_always_render_button/import-relationships-from-discogs.user.js)  
but unfortunately he didn’t react on pull requests (see [Pull requests · mattgoldspink/musicbrainz-userscripts · GitHub](https://github.com/mattgoldspink/musicbrainz-userscripts/pulls)) and nowadays (probably because of the new react based UI) it doesn’t work anymore … actually it sometimes loads (I have now idea what triggers it) when using “Edit Relationships” on a release, but then displays the following error “Could find Add Relationship button for #release-rels [data-click=“openAddDialog”]” and does nothing as can be seen from the following screenshot

 ![image](https://community.metabrainz.org/uploads/default/original/3X/e/5/e59b00269fe734b306f4ba7726590f260b26326f.png)

Maybe this is easy to fix but all this .js script stuff is way behind my horizon … ☹

---

<div class="post-metadata">

### Author: ![kellnerd](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kellnerd/32/66963_2.png) [@kellnerd](https://community.metabrainz.org/u/kellnerd)
#### Post date: [October 28, 2023, 4:10pm UTC](https://community.metabrainz.org/t/userscript-to-add-and-import-voice-actor-credits/566766/8 "2023-10-28T16:10:23Z")

</div>

Sure, supporting more relationship types (be it from Discogs or from text input) has been on my wishlist right from the start:

> <https://github.com/kellnerd/musicbrainz-scripts/issues/26>
>
> Collection of ideas to combine features of the Voice Actor Credits and Parse Cop…yright Notice userscripts and enhance it to be a general purpose credit parser and importer.
> 
> \## Unstructured notes
> 
> \- \[\] Parse release level credits from a textarea input
> \- \[\] Use OCR (maybe tesseract.js) for (booklet) images from the CAA or an URL to fill the textarea
> \- \[\] Use role descriptions to guess relationship types
> \- \[\] Customizable line parser presets (e.g. \`%role%: %artist% \[(%date%)\]\`, square brackets to mark optional parts)
> \- \[x\] Create a custom entity name to MBID mapping for each user (names are usually unambiguous then) and cache it
> - \[x\] CTRL click to circumvent mapping cache
> - \[x\] SHIFT click to force artist instead of label search (copyrights)
> \- \[\] Import credits from Discogs and other sources
> - \[x\] Import voice actor credits from Discogs
> - \[x\] Cache Discogs to MB entity mappings
> - \[x\] Suggest to link new matches (seed Discogs link for MB artist edit page) to improve mappings
> - \[\] Map Discogs roles to MB relationship types and attributes
> - Let the user select the correct type for unknown roles, cache it and suggest to share the new mapping data on GH?
> \- \[x\] Place UI before release relationships, checkbox to auto-focus (no unnecessary scrolling)
> \- \[\] Checkbox "Auto-parse (on paste)"
> \- \[\] Checkbox "Track level credits" to (un)select all recordings and works
> \- \[\] Checkbox "Add release relationships" (if appropriate) in order to be able to add only track level rels
> \- \[\] Checkbox "Use credited names"?
> \- \[\] Clean up pasted credit lines before adding them to the edit note (trim, replace tabs by dashes or similar)

Unfortunately I didn’t have enough time to continue working on this idea during the last year. Maybe I will get there by the end of 2023, but I can’t promise it.
