Filter based on differing Artist or Composer

Hi,

I'd basically like to create two lists: one contains all tracks that have an ARTIST tag that differs from the track's ALBUMARTIST. For example, ALBUMARTIST is "Michael Jackson": if the ARTIST tag contains anything other than "Michael Jackson" I want it in the list. The second list contains all tracks that have a COMPOSER tag that differs from a specified string. The specified string is necessary because the COMPOSER tag contains data that I can't compare against any other tag (well not always, but mostly.)

To be clear, this works per album: each album has it's own ALBUMARTIST and/or it's own specified string.

Would this be possible to do? Thanks in advance!

1st:
"$if($eql(%artist%,%composer%),yes,no)" IS no

2nd:
"$if($eql(specified string,%composer%),yes,no)" IS no

Thanks, can I directly use these lines in an export configuration file (e.g. 003 txt tag backup) or should I add anything?

No, you didn't mention "export" at all! And the name of the topic asked for a "Filter". So I gave you a Mp3tag fitler expression. http://help.mp3tag.de/main_filter.html

If you want to do an export, please tell us how it should look like. "e.g. 003 txt tag backup" doesn't help in any way. I have no idea what you mean with your specified string, maybe you should give some examples.

For a export list of all files where ALBUMARTIST and ARTIST are different:
$loop(%_path%)$if($eql(%artist%,%albumartist%),,%_path%
)$loopend()

A list of all albums where ALBUMARTIST and ARTIST are different:
$loop(%albumartist% %album%,1)$if($eql(%artist%,%albumartist%),,%albumartist% - %album%
)$loopend()

All tracks that have a COMPOSER tag that differs from a specified string:
$loop(%_path%)$if($eql(%composer%,specified string),,%_path%
)$loopend()

All albums that have a COMPOSER tag that differs from a specified string:
$loop(%albumartist% %album%,1)$if($eql(%composer%,specified string),,%albumartist% - %album%
)$loopend()

You're right, I only mentioned "Filter", but just to try to explain my goal. I had no idea that there's an actual Filter function present in Mp3tag (I know, I know...). I've tested both Export and Filter with your expressions and they work very well. I think I'm going to use Filter for the most part and perhaps the Export function in some cases. In short, your explanation and expressions are exactly what I needed... problem solved! :slight_smile:

In the meanwhile, I've run into several issues... I thought I'd just continue this thread, since the issues are only related to filter expressions.

  1. I'd like to check if some tags exist that aren't supposed to be there. For example, if want all files to contain only the %title% and %track% tag, any file must be listed that has a tag other than these two tags.
  2. I'd like to check if there's any tag missing. In the previous example: any file missing either %title or %track% must be listed. I've actually already done this, but with a lot of repetition, e.g.: %title% MISSING OR %track% MISSING OR... etc. I hope this can be done in a better way.
  3. It seems that the double-quote can only be used to delimit a string. I'm wondering how I can use it as a literal character (in a regular expression). " doesn't work...

Of course, if I run into more issues, I'll let you know.

NOT "$regexp($list(, <<<,>>>),<<<.+?>>>,)" IS "TITLE TRACK "

no better way as the one you are suggesting

As far as I know there is no way to esacape " in the filter.

Thanks very much! Could you explain your first answer? I've no idea what's going on there :astonished:

It's a filter expression again, as you probably have guessed yourself.

$list() is a undocumented function in Mp3tag. I have no idea why it isn't mentioned in the help files. Here is a very good explanation from DetlevD:
Lyrics aus Datei importieren?

The $regexp() function around it deletes tge values of the fields and the <<< >>> seperator and leaves only the blank field names wihth a single space after each name.

Use the Tag-Filename Converter if you want to see a preview of the functions (do not press OK):

$list(, <<<,>>>)
$regexp($list(, <<<,>>>),<<<.+?>>>,)

Thanks, it took me some time but I now fully get the expression :slight_smile:

I noticed however the expression is not quite what I mean. Let me try to formulate the problem a bit better:

Say, I've come up with a selection of 15 tags. All files are fine except any file that has one or more tags that it is not in the predefined selection of tags. In other words, all files that only contain a combination of the tags in selection are fine. The reason I say 'combination' is because some tags (title, track) obligatory and others (EAN, Publisher) optional.

At first I thought that replacing the string (on the right side of the equation) by a regular expression could solve my problem. Unfortunately it seems that the specific order of the tags almost differs per album:

COMPOSER Title ALBUM ALBUMARTIST Artist...
Title ALBUM ALBUMARTIST Artist COMPOSER... etc.

That means using an IS expression becomes very difficult unless I have a consistent order. Expressions like HAS and MATCHES don't have this problem but they make it very difficult to recognize if there's some unknown string present.

Any idea?

I found an interesting thread on this issue. It seems I have to create a giant action group to make sure the order is the same... or I have to come up with something that works well despite the order.

I hope this works:

NOT "$regexp($regexp($list(~,<<<,>>>),<<<.+?>>>,~),'~(album|composer|title|track)~',,1)" IS ""

Insert list of tag fields in the bold part.

Of course! It totally works :slight_smile:

There was also the chance to find this ...
How to filter files with more than "basic" set of tags?

DD.20120306.1717.CET