Load as Non-Album-Track Plugin Changes? / Plugin Questions in General

Looking at the Plugin API documentation, I’m still not able to figure out within the Plugin code what determines when the Plug-In Name is visible on the right click menu?

I’m sure it will need more added to the Plugin as well, but what I’m after is to be able to any matched tracks from the selected album(s) as Non Album Tracks.

So I thought I’d look at the NaT Plugin to see if I can possibly figure out what to add, where to put it, to do this stuff for me.

Right now, the only real way to load multiples is expand the album and individually pick each one. Selecting all the tracks in an album (unmatched included) will result in moving all of them over, so you end up with a whole bunch of empties in the [Single] listing. If you’ve got tracks sprinkled all over the place individually selecting each one can be tedious.

When you’ve got several tracks that you do not intend on having the whole album, hence, loading as non-album track, yet I want to get the proper metadata and perhaps even the cover art from the album that track is associated with if there’s not an official single release in the DB already.

To do that I’m letting it load with an album, saving it with embedded cover art and then changing it to a non-album track. … which means the cover art vanishes when the track is moved, but at least I have it in the directory on disk so I can drag it back onto the newly created ‘single’.

So, if Load as Non-Album Track were able to move the tracks and retain the cover art that may be already associated with it, be able to be chosen at the album title level having it only move matched track entries.

Since there’s no way to sort matched vs. unmatched within a release, you just can’t get rid of them all easily from the [single] album that’s created to hold them. If you’re adding many in there and want to deal with them all afterwards, you have a whole lot of empties to navigate around, select however appropriate and delete. Sometimes that’s highlighting the lowest in the list, hitting delete until you reach the one you want to keep, up arrow past it, and hitting delete some more.

Additionally, the API documentation implies that “Remove Perfect Albums” can be done on the left, to unclustered data… except it doens’t not show up as available in the contextual menu.

Plugins will have entries there if they register a context menu action. There are context menu actions for album, track, file, cluster or clusterlist (the last one is pretty special, it is about the “Clusters” entry under which all clusters are located). See the docs:

https://picard.musicbrainz.org/docs/plugin-api/#context_menu_actions

I don’t understand most of the rest of your post. As far as I can tell you are looking for a way to move the album art over to the loaded nat. This probably could be done by copying track.metadata.images over to nat.metadata.images in the loadasnat code.

An alternative would be to use the “No release” plugin, which has a similar purpose as the loadasnat plugin. But instead of loading a track separately as a non-album track it removes specific album specific metadata from the metadata.

Or you do the same with a script that you can run via context menu, something like:

$unset(albumartist)
$unset(albumartistsort)
$unset(albumsort)
$unset(asin)
$unset(barcode)
$unset(catalognumber)
$unset(discnumber)
$unset(discsubtitle)
$unset(media)
$unset(musicbrainz_albumartistid)
$unset(musicbrainz_albumid)
$unset(musicbrainz_discid)
$unset(musicbrainz_releasegroupid)
$unset(releasecountry)
$unset(releasestatus)
$unset(releasetype)
$unset(totaldiscs)
$unset(totaltracks)
$unset(tracknumber)

I don’t think the API documentation says this. There is no concept of a “perfect album” on the left since there is no album data available to begin with. There are only unmatched files on the left, and clusters of unmatched files (which basically means a bunch of files that probably belong together).

1 Like

Context Menu Actions

Right-click context menu actions can be added to albums, tracks, files in Unmatched Files, Clusters and the ClusterList (parent folder of Clusters).

Which is kinda what I thought, but then I somehow interpreted the header line from the example to mean it was for the given example with it. :wink: So … anyhow. Yeah. That’s settled.

I see the register_album_action(RemovePerfectAlbums()), and I presumed that in conjunction with NAME = 'My Amazing Plugin' would be to get it listed. What I’m asking is what determines when that shows up in the contextual menu? Does it do it automagically based on the plugin function?

It shows when applicable tracks are selected for it

But not here, when the Album is selected … Even though Albums are among that selected group.
Selected by all because I want all those tracks as singles, but it’s either tick them all one by one now, or delete the ‘empty’ ones afterwards.

I know, selecting the [Single] ‘Album’ for Saving will only save the ones with matched tracks. But I’m not done with them yet, I may still want to manipulate metadata … and if there’s more than a couple albums so far in the list, you’ve got a lot to scrolling to do when going between them, vs just not having those there at all.

As for the rest of the post:
If when Adding as Non-Album Track retained the artwork that may already be there, and when mass selecting whole ranges or just by the Album title, would only act on tracks with matched data … as in the above screen shot, all of those tracks will be added:

To get rid of the empty ones, you’ve got to select them… of course:

…and it could be tedious when you’ve got tracks “all over the place” as opposed to larger swaths in the listing to select in larger ranges.

So you can see this:

As for that No Release plugin: Whats the magic potion? As you can see above, it never shows up anywhere. It’s enabled. It’s been enabled, I’ve just never seen it. Though now that I have somewhat of a better understanding of messing with this on the code level, I didn’t look to see if the API was set to 2.0 or something…

Yes. There are 5 types of context menu actions a plugin can register (album, track, file, cluster or clusterlist). The action shows up when at least one element of the specific type is selected. The action then gets executed for all actions of this type.

The loadasnat plugin registers a track action, hence it shows up when you select tracks. The no_release plugin on the other hand registers an album action, so it shows up when right clicking an album.

Some plugins register for multiple types, e.g. the papercdcase plugin can be used on albums and clusters.

It probably would kind of make sense to have the loadasnat plugin provide an album action as well.

1 Like

Once you said the papercdcase can be used on … I see now. What I was having issues with is, I can kinda see where that is mentioned on the script page, about registering. I see register_x_action But it’s not clear (at least to me) at all what arguements are available as X. (album, track, file, cluster or clusterlist)

But Now I also see another part to making an options menu item. register_options_page… to get something to show up on the Options menu.

So I need to figure out the nomenclature for when/what gets used with register.

…and have it skip unmatched tracks, which I presume shouldn’t be an issue as it’s just going to do something with is_matched or linked.files, somehow, something…

I literally never touched Python before I started this ‘project’, or much of any of these scripting languages that the ‘internet has brought’ us…

The bulk of my development experience comes from the Apple II… as in 1982 :wink: … : Merlin Assembler mainly. The concept of an IDE wasn’t even a blip on the radar. So this whole thing has been good for me too. Editing a line, building and seeing something show up on a GUI / desktop application is huge to me. :slight_smile:

I’m disgusted that I never looked into Picard this closely, much sooner. I’ve had it installed, been using it since the who knows when, but all that stuff was just voodoo to me and I would just ‘wait’ for changes to come along… This is one of the very few discussion forums that is active and friendly to use. It’s been very rewarding, and to finally get this 10 ton gorilla of data organized…

Even this forum, whatever it’s running on, I like it, and would like to use it if/when I need a discussion forum. I suspect that it was custom written for here though… not ‘one of those’ pre-packaged things.

I’ve got some things running around in my head that Picard’s workflow/versatility make a great framework to start with. I just need to get way more into Python. But that’s for another thread…

Thank you all for creating the entire Metabrainz Foundation… I should Note that if it were not for the Grace of greed… none of this would exist the way it is now. I contributed a fair amount to CDDB and was fairly disgusted when that changed. So much so that I’ve been put off by it for this long. The 2.2.0 release was a huge spark, and nearly perfectly timed for me.

Anyhow, enough rattling off topic.

1 Like

Off-topic indeed, but this forum runs on Discourse. Which I guess counts as a “pre-packaged thing”.

2 Likes