What am I doing wrong with this find filter?

I want to find all folders that contain at least one flac and also one mp3 audio file. I know that there are at least two such folders. The following is the find panel with the filter I entered, but it doesn't return any folders.

If I deselect one or the other of the file type filters it works as expected.

What am I doing wrong with it?

Thanks.

[Edit]

I just had a bright idea and the following filter works. I guess I have my answer, but I'm not sure why because the logic doesn't seem to be any different.

The first version looked for files that were .mp3 and .flac simultaneously.

3 Likes

As @lxp suggested, a Folder content clause looks on a per-file basis to match content within the folder - that is, every file within the folder is tested (one at a time) against the clause, until a file is found that matches. A file can't be both an mp3 and a flac at the same time so every file fails the test.

Just change the second "And" to "Or".

That would clash with

Ok, thanks. Looks like that filter clause would have to be replaced by a script or at least something much more complicated then.

No, the second filter clause should work: contains 1 flac, and contains 1 mp3 (at least for both conditions).

Yes, the second filter clause works.

After coming up with the second clause, the behavior made perfect sense.

The problem, for me at least, was that initially it seemed like the "Folder content" filter would operate on the folder. So it seemed like the first filter clause should have found all folders that contain both an mp3 file and a flac file.

And the only entry I could find in the online manual about the folder content filter was in the Directory Opus 13 Detailed release notes: "Added 'Folder Content' filter clause. Lets you search for folders containing files that match the specified criteria."

Once a person figures it out, the behavior makes perfect sense, and I wouldn't suggest that it be changed. Maybe it's just a quirk that needs to be learned.

On the other hand, maybe a name other than "folder content" would be more immediately clear. Or maybe an entry on the Filter Clause Types page of the online manual would be sufficient.