Support for Function Composition within Filters

Consider the AND filter function in mp3tag. Here is a working example of an expression which returns tracks from my F drive with missing covers:

(%_path% HAS "F:") AND (%_covers% MISSING)

Now, I would like to add another criterion: I want my filter to also return tracks from my F drive with covers. So the filter now should return tracks from F drive with missing covers and tracks from E drive with covers. However, the following expression does not work:

((%_path% HAS "F:") AND (%_covers% MISSING)) AND ((%_path% HAS "E:") AND (%_covers% HAS 1))

It seems that expressions cannot be composed in such a way, is this correct? If so, is there any workaround to achieve this ((w AND x) AND (y AND z)) functionality?


Yet, I think that the middle AND is (logically) not correct. It should be an OR.
(I mean the files cannot be both - be from drive f and e and also have covers and haven't)

So try:
(%_path% HAS "F:" AND %_covers% MISSING) OR (%_path% HAS "E:" AND %_covers% PRESENT))

You're right! Just needed to change the middle AND to OR. Also, thanks for the suggestion to use (%_covers% PRESENT) instead of (%_covers% HAS 1). For anyone wondering what the difference is, the former will return all tracks with any amount of covers whereas the latter will return tracks with n covers where n contains the digit 1. For example: 1, 10, 21, 141 etc.

Thank you very much, big up!

Not quite. It will return any amount of covers that includes the digit 1, so theoretically 10, 11, 12 ... 19, 21 would also be included.
If you want to limit the number of covers to exactly 1 then use
%_covers% IS 1

More on filters can be found in the documentation:

True, updating my previous reply to reflect this. Thanks again!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.