[WS] MusicBrainz expanded

2024-10-10 - Update v2.20

  • ADD: Added a new possibility to "Search by Artist + Album + Tracks + MediaType + Country" (thanks to @zerothbase)

Based on the idea here and since the Mp3tag version 3.27c it is possible to use more then 3 search fields in a Web Sources Script.

This is an example how the MusicBrainz search could be expanded up to five search fields:
image
In the above example the search for the MediaType and/or the Country was added.

Most common MediaType on MusicBrainz are "Digital Media" and "CD" and "Vinyl", but there are much more. Just a few more examples:
image
Search hint:
If you want to search for the MediaType 12'' Vinyl, you have to enter it with two apostrophes after the size, like this
"12'' Vinyl"

Another hint:
You don't have to fill out every field. You could also search for all US CDs from the band Depeche Mode with:
image

Just give it a try and let me know how it works for you.

MusicBrainz expanded#Search by Artist + Album + Tracks + MediaType + Country.src (3,0 KB)

3 Likes

Since way back I'm missing a standard sub search Albumartist + Album.

When I select all files of any CD and even more so of a multi discset compilation, I really want to search with die Albumartist, not the Artist from the first file in my list:

So I have added a

MusicBrainz expanded#Search by _myAlbumArtist + Album.src

With the following change:

# 2022-01-15    v1.00
# 2024-06-01    v2.00   adjusted for newest .inc WSS script
#
#######################################################################
# Remove some non-working special characters from pre-filled search string
#[SearchBy]=Album||$regexp(%album%,'[(){}\[\]^"~*\\]',)||release:%s||Artist||$if(%artist%,$regexp(%artist%,'[(){}\[\]^"~*\\]',),)||%20AND%20artist:%28%s%29

### MusicBrainz - Search by AlbumArtist + Album
[SearchBy]=Album||$regexp(%album%,'[(){}\[\]^"~*\\]',)||release:%s||Artist||$if(%albumartist%,$regexp(%albumartist%,'[(){}\[\]^"~*\\]',),)||%20AND%20artist:%28%s%29
[Include]=MusicBrainz expanded.inc

Now it is spot on:

Maybe useful to others, too

Cheers

2 posts were split to a new topic: Can not reach musicbrainz.org with WSS

2025-04-22 - Update v2.30

  • NEW: The additional column "Disambiguation" (2) is now displayed in the search result
  • ADD: Included the possibility to search by Album-Artist + Album from @make-nz
    (thanks for the permission to redistribute it!)
  • FIX: DISCNUMBER 1/1 settings should now be correctly respected
2 Likes

To adjust this WSS I would need some more examples.
@shyfx Could you please tell me some links to MusicBrainz albums where you get multiple countries, for example

1 Like

I will look deeper in to it.

For the moment i am busy with writing a tag scripts for the musicbrainz app combined with mp3tag app .

I combine mp3tag data (more album level= albums as they are) and in musicbrainz I force to look up tracks individual (= more at album, ep and single level (=try to get more info for tracks on compilations/ best-of albums))

It provide me to get more and different data in function for compilation albums.

I work for the moment with only 800 test tracks.

From from memory, in those test tracks, there are 2-3 albums that give those results.

For 2 of of those I am 100% sure that they contain more then 1 involved artist.

It looks that that the plugin gives the results for all the artists involved.

For 801/phil manzanera live it gives GBGB (there are 2 artist involved in album, 801 (group) and phil manzanera (artist))

For A Retrospective of House 91'-95', Volume it gives GBGBGB (there are 3 artists involved in album, don’t know all 3 of them from memory. (judge jules, john pleased woman and a third one i don’t rember the name)

Give me 7-14 days and I will provide more feedback.

thnx

1 Like

I had to reload my tracks today :confused:

What I did:

I did use a fresh copy of MusicBrainz expanded (v2.30) (Because I made some changes in the part ā€œMusicBrainz expanded.INCā€ I use)

I run the album ā€œA Retrospective of House 91'-95', Volume Oneā€ and made a screenshot.

There you see that there 3 artists involved.

I believe that the plugin search for the 3 countries for the 3 artists what is in my eyes correct.

(The artists are all 3 of the UK)

So you got 3 2-digit land codes (GBGBGB)

The plugin should just output those separated with:

-a dash? ( )

-a semi colums? ( ; )

-a comma? (,)

-2 back slashes? (\\)

The same story with albums with 2 artists involved, it output 2 times 2-digit landcodes.

I hope I was from help with this.

If needed I will provide more example albums

Grrtttzzzz

1 Like

2025-08-23 - Update v2.31 (Bugfix release)

  • FIX: Display Barcode, ASIN and Status column content again in "List of search result" window. (Tag fields themselves were not affected.)
  • FIX: Add / as separator between multiple Artists-Country-Codes (thanks to @shyfx!)
  • FIX: Add § as separator between multiple Releasegroup_ArtistCredit_Joinphrases
    (because the usual separator / is often already used as visible character:)
    MusicBrainz Releasegroup ArtistCredits:

    Mp3tag new separated Joinphrases:
    image

Special hint for @shyfx:
If you like to separate the country codes in MB_ArtistCredit_Artist_Country with another character than a slash /, just replace the separator character on Line #708 in the file MusicBrainz expanded.inc with another one, like ;

2 Likes

It’s my pleasure.

Thank you for your tip, effort and time and this nice plugin :slight_smile: :slight_smile:

I have one question.

At the bottom of the the script ( around line 1500 from the ā€œMusicBrainz expanded.incā€ file), there is a list with items that you can change

from #set ==> to set.

In this list I don’t see ā€œMB_LABELINFO_PUBLISHER_SORTNAMEā€

Can I add a line to hide the item ā€œMB_LABELINFO_PUBLISHER_SORTNAMEā€:

set ā€œMB_LABELINFO_PUBLISHER_SORTNAMEā€

Or how do I handle such thing best?

I once tried to delete a line outputto and the plugin gave me an error :sad_but_relieved_face:

Sure!

The SET command at the end of the script completely deletes the current content of the following variable.
This means, if you add/activate the SET command with
set ā€œMB_LABELINFO_PUBLISHER_SORTNAMEā€
you will never see MB_LABELINFO_PUBLISHER_SORTNAME with content anymore as fieldname in the upper right metadata field of the script result.

This is also true for every other variable (there are some more MB_LABELINFO...)
Usually, this SET command is used the clear/delete temporary variables.

1 Like

Thnx,

I don’t know if there is interest for, or that you going to like this.

I wrote an action that set a tag if album is complete or not.

There are methods here on the site to do this.

But this methods runs pure on 1 action and there is no need to set a temp field with the track numbering wizard.

You look up album with your plugin, then run the action.

Done :slight_smile:

I added 2 files.

1e with the action set a tag if album is complete or not. (field: ALBUM COMPLETE?)

2e with the part I added extra (MusicBrainz expanded (v2.30), search for ā€œ# Start set TT"

around line 987), you have to change the extension fro .txt to .inc

I was able to grab the The total tracks from 1 or multiple albums from 1 release. ( I don’t know nothing of the jason lingo)

Not everybody is capable to adjust the source script or handy to write actons.

Maybe it is a good idea to release the action and your plugin as 1 packet.

So everyone can benefit.

The action could be shorter if you can grab the totall tracks as number.

Now i grab the total tracks/disc (I did go to 20discs deep, because i know a release with 20 discs) and split hose in different fields, then add those up.

This part could be eliminated So basically you end up with ([#0], [#20], [#21], [#22])

Grrtttzzzz

Album complete.mta (2.1 KB)

MusicBrainz expanded v230.txt (68.2 KB)

Thnx

Take a look and say what you think.

https://community.mp3tag.de/t/split-country-gb-gbgb-gbgbgb-to-gb-gb-gb-gb-gb-gb/69495/11?u=shyfx

I posted it wrong, so I sended a link :confused:

Please feel free to add your modified version as your own named Web Source Script contribution here:

Don't forget to include screenshots and a full description of what you are trying to achieve.

Personally, I don't think it's a good idea to add field names whose content cannot be identified by the name (like your P002 until P052. It is difficult to identify P019 as former 'MB_ArtistCredit_Artist_Country' for example).
Also adding redundant information as in your custom MALBUM with the same information that is already avaliable in ALBUM is not really necessary, IMHO. The same is true for your custom MALBUMARTIST which is (nearly) identical to the offical ALBUMARTIST.
I would not recommend naming variables with special characters, such as a question mark (?) in ALBUM COMPLETE?
And please don't forget to remove temporary variables like TEMP_DISCNUMBERONETOGGLE.

Example result using your script:

As mentioned: Please add your modification as your own contribution to this Development > Web Sources Scripts category and provide a clear description of your goal.

I am sorry,

All the ā€œall the custom tagsā€ are for my script in combination with musicbrainz…. and is for my own use.

So ignore those please.

Only the line what i provided (ā€œ# Start set TT" around line 987) should be altered.

That is the only one that is needed for the action….

All the rest must be original like it was.

You want to add these 12 lines #987 until #998 to the script?

         # Start set TT"
        json_select "track-count"
            # Clear content for each loop
            set "MB_Media_TrackCount1"
            outputto "TT"
                    IfOutput "TT"
                    IfNot ""
                        say ";"     # add a slash if current content is not empty and a new TT will be added
                    endif
                endif
                sayrest
         # End set TT"

To get this additional field TT in every track?

image

image

image

Would you mind if I rename the fieldname TT to something like TOTALTRACKS_PER_MEDIUM?

Just to be sure:
You know that this number of total tracks already exists in the field TRACK after the slash?
2/15 means second track of total 15 tracks.
Combined with the existing DISCNUMBER 1/3 you know that this is the second track (of 15) on the first medium (of 3).

Hi,

thank you again for your time.

I tried to grab the yellow value, but i didn’t found that :confused:

So after 3 hours and by chance I ended up with the red one.

I wish I could write a source script, but I can’t.

Ideal should be the yellow value.

Why?

The action becomes shorter, what I think is better.

Now in this release I place 3 field with 12, 14, 14 (comes from format)

(There are releases that have 20 discs, So I must write 20 fields)

Then I add those 12+14+14=40 (=the yellow value ā€œtotal tracksā€))

If you can get the yellow value, that would be awesome.

Then the action would be executed in only 4 steps ( now are those 23 steps)

If not, or to complicated the red value will do.

The name is all yours.

I rewrite the action with the name you provided send it back.

I will write a txt-file with howto add the action and steps to use. (the last part is easy :laughing: )

So that everything is compatible.

You can add that with your plugin and can be downloaded as 1 packet for all the Mp3tag community.

At least if you agree and like this idea.

For me this sound logical.

If someone try to use this action with a discogs plugin or without a plugin ,this action won’t work and may cause confusion.

Also the community don’t have to site-jump for the plugin and the action.

Grrrttzzz

Hi,

The data has to be in every track.

This part is correct.

The ā€œTT valueā€ is (after calculation) how many tracks there are in total for the release.

So if posible the yellow vallue please (Action becomes shorter)

The total_files (%_total_files%) comes from Mp3tag.

This ā€œcountā€ how many files there are in albumfolder.

In this release you get:

40 (ā€œTT valueā€ from your plugin) and 40 ā€œtotal_filesā€ from Mp3tag in each track.

After compare this value (40=40) it will set a tag for each track for that release ā€œalbum completeā€.

If i miss a track You wil get:

40 (ā€œTT valueā€ from your plugin) and 39 (ā€œtotal_filesā€ from Mp3tag) in each track.

After compare this value (40 not equal 39) it will set a tag for each track for that release ā€œalbum incompleteā€.

You can set this data in 1 track and make 1 compare.

The result will be correct for the whole release. This is correct.

But for what I know it is not possible to copy that tag from 1 track to the other tracks from that release.

The data (ā€œTT valueā€) has to be in every track from that release for that reason.

Otherwise if I made the compare between the

Unfortunately there is no way to get the number for "Total Tracks" (yellow 40 in your example) from the "List of search results..." into a specific tag field in your albumtracks.
Currently it is also not possible to use any arithmetic function like $add() to get the sum of the total tracks per medium.
You could try to achieve that in a separate Action as first step before your other comparisons.

The only remaining option to get at least the numbers in red (12 and 14 and 14 in your example) is to inject the 12 lines above into the original Musicbrainz_expanded.inc file.

I can make a note for a future version of the script to include these lines.
But I will use
set "TOTALTRACKS_PER_MEDIUM"
at the end of the script for all users. So if YOU want to use it, you can just add a # in front of the set command to see and use the content of this new field.

What do you think?

Morning,

I have a night shift later and this is quite a sandwich to wake up to.

Thank you for your time and effort to find out what is possible or what not,

and explain them.

Like I said earlier, the name is yours, so"TOTALTRACKS_PER_MEDIUM" is fine for me.

The option to set/unset that variable would be great.

thnx :slight_smile:

Hi, thank you for developing this script. Throughout usage on classical music albums, the script often fill the composer as the artist, instead of the performers. How can this be fixed?

Many thanks!