Prevent action group from running on file type and/or directory

I have a few action groups that i would never ever run on my main archive. In order to prevent accidentialy executing them on it i ve added an "if extension equals flac, dont do this action" to every single action within the groups.

I would like to request a much simpler way of preventing mp3tag to run an action group on a directory or on a file type: the ability to add one primary if statement to disable all actions within a group.

You can tick the actions that you want to be exectued.
You could also apply a filter to get only the files that you want to treat.
Then you could save a number of configurations of actions that cater for different purposes and load these configurations after you have applied the corresponding filter.

Yes, you can tick the action groupd you want executed.
You can also accidentialy tick the action groups you dont want to be executed.

And yes you can use filters to prevent this, but you have to apply the filter to every action! this is a feature request to get a filter for the whole group.

The filter works on the currently loaded files - just like executing actions does.
So the filter is not focussed at the actions but at the files.

Ok lets take this simple action group as an example:

if i run it on my main music directory, where the files are in
E:\Musik\Musik\%artistfile%\%year% ~ %albumfile%$num(%track%,2) ~ %titlefile%.flac
it shouldnt do anything because the extention of every file is flac.
if i run it on
it should add the cover to whatever opus, mpc or mp3 file i just made

if i work on the main directory i wouldnt use that action anyway, but the if statements are there in case i accidentially use that action on my main music directory

i have to specify $if($neql(%extention,flac..... for both the png and the jpg import action. those are only 2 but if there are hundreds of actions in the group, i need to do it hundreds of times.

Thus my request for an option to add a single $if($neql(%extention,flac..... to the action group and it working on the while action group, no matter if there are 2 actions or hundredts of actions in it

It is hard to judge from the distance how streamlined your workflow is.
But if you have definite conditions when to run an action and when not then I would put all these actions into a single action group, filter with a suitable condition and then execute the action as required.
The overall condition that you state is, IMHO, a filter.

This being my idea until the feature is implemented.
I do not know how pressing the problem is for you. If you see it as blocking point then I would consider the filter and rearranging the actions.

I see your point, basically.

But where do you draw the line?
You could also have opus, mpc or mp3 by accident in your Musik directory.
You could have many more conditions that accidently match your worst case.

I'm not sure if such a "main condition" would really solve the problem.

yeah, the filter on the whole group is what i want

if it is already possible to do this, i would like to know how. as i couldnt find anything in the documentary that would explain how.

(it isnt the most pressing concern as i have basicaly added if statements to all actions in the action groups that need them)

well if the main condition would be "if not this directory" then it wouldnt work on hypothetical lossy files in the main directory either.

Here is the part in the documentation:

The idea would be to apply the filter first and then execute the action group(s).
There is no way to make a filter part of an action group.

ok, so then the feature request would be:
"enable filters to be part of action groups"

see. e.g. this discussion from 2018:

As you can save filters and assign a name to them, you could create an environment in which you remember which filter would fit which actions.
So far I see problems with 2 sets of filters: the one in the filter box and the one in the actions. Which would have priority? Would only 1 be the valid filter and overrule the other one?

For the time being I see labelled filters and dedicated configurations of action groups as the way to do it.
Until the feature is implemented, of course.
But any effort that you spend right now to overhaul your actions and filters will be worthwhile as that technique will probably sustain and is there right now.

So if i understand it correctly, the filters are a file selection thing. (in with case the search filter would work first, and the action filter would further refine the selection within it)

I do find it odd however that on a proposal to add a slightly easier createable safeguard against selecting the wrong files and run an action on it, you keep telling me the solution is to select the right files before running the actions. - thats like saying you dont need lifeboats if the ship isnt sinking in the first place.

I know that there is currently no way to group actions in respect to overall conditions ... except with the filter.

And as there many ways to achieve certain goals I just tried to ouline a way that is already possible.
I cannot say how important the whole thing is for you. But the more pressing a solution should be required, the more the solution leans toward already existing functions.

I think the logic is just in how you are executing your workflow versus how mp3tag currently is designed.

The current mp3tag method after loading a group of files:

  1. Apply a FILTER to ensure only files are selected that you intend to execute any ACTION.
  2. Run the ACTION(s) you want to execute to make an intended change.

What it appears you are asking is to have step 1 to be included in some or all of your custom ACTION(s) so that these FILTERS get applied regardless of what may or may not have been done in the main window. Since the FILTER choices can be saved as well, I'm not sure this is saving you much more than a few seconds.

My concern from a design perspective would be the impact on running an ACTION on a target group of files, where you would expect all selected files in the main window to be modified. But due to the internal filtering some, or perhaps even all, of the files selected may not actually have any change applied. For a single file, or even a small batch, this may be obvious and allow you to make adjustments to correct the intended ACTION. But if this is done when executing the ACTION on a larger set of files this may not be so obvious.

ok, it is a workflow thing, but i still dont understand:

why would you even load files into mp3tag that you then need to filter out?
im generaly working on all files within a directory, (which is either the main archive, the new stuff folder or the throwaway lossy folder)
and in the very very rare cases where i only need to run an action group on a few of the files, i just handselect them with shift click.
(guess youd call that the same thing as using the filters)

And as we cannot look over your shoulder and see which way would lead to similar results.
I think you got the idea that the filters are a function to limit the number of files to just those that should be treated.
It is up to you to experiment with this function for the time until your feature request is implemented.

With that logic the same could be said about your request to include a filter in the action you have requested. :thinking:

But there are plenty of reasons to apply a filter first. Even within a single Artist or Album there may be an Action to be applied that still has to be reduced to a specific set of those files. Within a subdirectory of any kind this can often be the case.

This is a manual filter method, but the actual filter function can be far more powerful.

... could i get an example of such a case? genuinely cannot fathom a situaton where i wouldnt simply have an action that can be run on all files of the artist.

It really depends completely on what each user may have as their prefered folder structure. And what you are trying to do. What if you are working on a complete library directory? Some users have no defined folder structure at all, but have many music files lumped into a single folder.

A simple example may be to look at The Beatles. They have plenty of albums, but perhaps you want to apply an action to FORMAT a user-defined value for a field called SONGTYPE with a value "Love-Titled Songs" for any of their songs with the word "Love" in the Title.

  1. Filter for %title% HAS Love in the main window after loading your Beatles directory.
  2. Apply the Action FORMAT VALUE for field SONGTYPE with "Love-Titled Songs"

This wraps back to your original request though - if there is no reason to have a filter, why do you need to add one within the action in the first place?