What happened to the %original_performer% tag?

My script used to pull the original performer tag and add it to the title of the song/filename. I.E.: (Metallica Cover)

But now it’s not adding the tag or even retrieving it. Looking at the add be l new tag in picard it’s not even there. Though there is one now called originalartist that also isn’t pulling any data. (I’ve checked with songs that previously had that info pulled and saved.) I would have to have to manually add that info to reach song.

I am not aware there ever was a original_performer tag. Was this maybe provided by some plugin you used or you had a script setting this tag?

originalartist is currently not populated automatically with any data, but it is read from / written to files.

UPDATE: There is the following ticket requesting filling the original performer from MB data, but it has not come to a final conclusion how to use the MB data for this:

2 Likes

I’m not sure. I thought it might of been a plug-in even i found it not working but i couldn’t find it anything in my installed plugins.

I did see the page too but since it was working and has been for the last few years. The probably wasn’t it either.

I did find this with the second hands song db listed saying it has advanced relationships. But i have no idea how to use or access that in picard.

https://musicbrainz.org/doc/Other_Databases

Here ib took a screen shot of one of my tracks to show the tag is there and it’s in the filename. But picard won’t even add it to the track name if it didn’t pull that information directly i guess.

I just checked. The last time it added the tag to my music that I’ve been able to see was on 07-19-2020. It added it to songs on 4 Albums I tagged on that date.

Aha i found it. it’s a plugin that i guess isn’t compatible with 2.x. i wonder how i could go and update it.
I can’t even find any info on it online which i strange.

PLUGIN_NAME = 'Song is cover of...'
PLUGIN_AUTHOR = 'Rodolfo Gonella Diaza'
PLUGIN_DESCRIPTION = 'Obtain information about the original performer of a song. In case of cover creates "original_performer" tag. In case of medley creates "medleyof" tag.'
PLUGIN_VERSION = '0.2'
PLUGIN_API_VERSIONS = ["1.3"]
 
from picard.metadata import register_track_metadata_processor
from picard.log import debug
from picard.log import warning
import re
 
def get_element_by_targettype(source, t_type):
	for e in source:
 	    if e.target_type == t_type:
			return e
	return -1


def get_original_artist(source, track_artist):
	orig_artist = []
	orig_artist_all = []
	
	for p in source.work[0].relation_list:
		if p.target_type == "recording":
			debug("\ttrack has %d recordings" % (len(p.relation),) )
			for r in p.relation:
				if hasattr(r, "attribute_list"):
					continue
										
				try:
					if hasattr(r.recording[0].artist_credit[0].name_credit[0], "joinphrase"):
						continue
					if r.recording[0].artist_credit[0].name_credit[0].artist[0].name[0].text in track_artist:
						debug(r.recording[0].artist_credit[0].name_credit[0].artist[0].name[0].text + " in " + " - ".join(track_artist))
						continue
					
					
					debug (r.recording[0].id)
							
					if r.recording[0].artist_credit[0].name_credit[0].artist[0].name[0].text not in orig_artist:
						orig_artist.append(r.recording[0].artist_credit[0].name_credit[0].artist[0].name[0].text)
					
					orig_artist_all.append(r.recording[0].artist_credit[0].name_credit[0].artist[0].name[0].text)
					
				except Exception as ex:
					debug("Something wrong among the nested elements")
					template = "An exception of type {0} occured. Arguments:\n{1!r}"
					message = template.format(type(ex).__name__, ex.args)
					debug(message)
					return -1
					
			break
	
	if len(orig_artist) == 1:
		return orig_artist[0]
	else:
		debug("\t" + str(len(orig_artist)) + " original recordings found by " + ", ".join(orig_artist))
		mostcommon = max(set(orig_artist_all), key=orig_artist_all.count)
		debug("Most common: " + str(mostcommon))
		return mostcommon

	return -1
	
def get_medley_songs(source, track_artist):
	songs = []
	for s in source:
		medley = False
		for c in s.attribute_list[0].attribute:
			if c.text == "medley":
				medley = True
				break
		
		try:
			if medley:
				songs.append(s.work[0].title[0].text)
		except Exception as ex:
			debug("Something wrong among the nested elements")
			template = "An exception of type {0} occured. Arguments:\n{1!r}"
			message = template.format(type(ex).__name__, ex.args)
			debug(message)
			continue
			
	return songs

def add_trackisacover(album_id, metadata, track, release):
	c_original_artist = ""
	c_cover_type = ""
	c_songs_in_the_medley = ""
	
	debug(metadata['title'])

	if not metadata['~performance_attributes']:
		debug("\tNo '~performance_attributes' found in metadata")
		return
   
	if "cover" in metadata['~performance_attributes']:
		c_cover_type = "cover"
	if "medley" in metadata['~performance_attributes']:
		c_cover_type = "medley"
   
	if c_cover_type == "":
		debug("\tNo cover type for in '~performance_attributes'")
		return
   
	if not hasattr(track, 'recording'):
		debug("\tNo 'recording' attribute found in 'track'")
		return	

	for r in track.recording[0].relation_list:
		if r.target_type == "work":
			work = r
	
	if work == -1:
		debug ("\tNo 'work' among the track relationships")
		return
		
	relations=work.relation	
	
	if c_cover_type == "cover":
		c_original_artist = get_original_artist(relations[0], metadata['artist'])
		if c_original_artist <> -1:
			metadata['original_performer']=c_original_artist
		
	elif c_cover_type == "medley":
		all_medley_artist = []
		for s in relations:
			cur_orig_art = get_original_artist(s, metadata['artist'])
			if cur_orig_art == -1:
				continue
				
			if cur_orig_art not in all_medley_artist:
				all_medley_artist.append(cur_orig_art)
			
		if len(all_medley_artist) == 1:
			metadata['original_performer'] = all_medley_artist[0]
		else:
			debug("\tMedley artists: " + " - ".join(all_medley_artist))

		 
		OriginalSongs = get_medley_songs(relations, metadata['artist'])
		if len(OriginalSongs) > 0:
			#c_songs_in_the_medley = "(" + " - ".join(OriginalSongs) + ")"
			metadata['medleyof']=OriginalSongs
	return


register_track_metadata_processor(add_trackisacover)

Interesting, first time I see this plugin.

In general this should be adaptable to Picard 2.x, but I have just quickly skimmed over it.

One quick test could be to just change

PLUGIN_API_VERSIONS = ["1.3"]

to

PLUGIN_API_VERSIONS = ["2.0"]

With some luck it’ll work, but there could still be some incompatibilities. I can take a look, but need some time.

1 Like

I dunno if it matters, but there’s also a coverof.pyo file with it as well.

Also, Nope. changing it the API_VERSIONS to 2.0. gave an error when i tried to load it:

An error occurred while loading the plugin ‘coverof’:
Plugin ‘coverof’

darn. i was hoping.