1 (edited by daffdaemon 2015-11-12 23:04:00)

Topic: Filter Fail

Filter this list of files:
20031113 - Artist1; Artist3 - Album21.jpg
20041021 - Artist2; Artist3 - Album01.jpg
20041103 - Artist3; Artist1 - Album02.jpg
20041109 - Artist3; Artist1 - Album03.jpg
20050228 - Artist1; Artist2; Artist3 - Album10.jpg

*Artist1* gives me 4 files
*Artist2* gives me 2 files
*Artist3; Artist1* gives me 0 files

The semicolon is causing the filter to fail
If I remove it:
*Artist3 Artist1* gives 2 files

Filter also fails with subdirectories loaded.
If the list is a list of folders:
20031113 - Artist1; Artist3 - Album21
20041021 - Artist2; Artist3 - Album01
20041103 - Artist3; Artist1 - Album02
20041109 - Artist3; Artist1 - Album03
20050228 - Artist1; Artist2; Artist3 - Album10

Each folder contains 1 file like the folder name with .jpg extension and many other files with simply numbered filenames.
*Artist1* gives all files in 4 folders
*Artist1*\*Artist1* gives 0 files

Ah, Got it!!
*Artist1*\\*Artist1* gives 1 file from each of 4 different folders.

But *Artist3; Artist1*\\*Artist3; Artist1* still gives 0 files

Re: Filter Fail

Hello,

This is a bug. The ";" is a metacharacter in a Siren filter.
If it is normal not to find anything with : *Artist3; Artist1*
It shouldn't be the case with : *Artist3\; Artist1*

I'll try to find a solution to this.

Thanks

3 (edited by Rémi 2015-12-10 11:32:51)

Re: Filter Fail

Hello,

I have corrected the bug (and maybe add new ones ...).
Now the filter "*Artist3\; Artist1*" works.

To limit the blockings I intend to add a new feature :
if a filter begins with "/" all what follows will be seen as a regular expression.
If a name matches, it passes.
For example :
*.txt could be rewritten as : /\.txt$
*.jpg;*.png could be rewritten as : /\.(jpg|png)$
*Artist3\; Artist1* could be rewritten as : /Artist3; Artist1

Selecting file with names containing 1 to 3 following 'a' could be written as : /a{1,3}
Selecting files starting and ending with twice the same 3 characters sequence (abcxxx.abc) could be written as : /^(...).*\1$

By default the match would be case insensitive but, as the regular expression implementation Siren uses allows it, this could be changed.
For example : "image.PNG" won't match "/(?c)\.(txt|png)$".
Searching a '/', under GTK/Linux for example, could be done by preceeding it with "\".
This should work for filtered sub-expressions too.

What do you think ?

Regards

Remi

EDIT : I have also corrected a bug that appeared in version 3.13 : the name filtering was done on the "full path + full name" instead of only the full name ...

Re: Filter Fail

Rémi wrote:

if a filter begins with "/" all what follows will be seen as a regular expression

Excellent solution!

Re: Filter Fail

I like it, Remi.

I've also found myself wishing there was a simple way to invert the filter.
Like:  NOT *.jpg would show list with all .jpg files filtered out.
What do you think?

Re: Filter Fail

Hello,

This can be done for all other selection tasks through radio buttons.
Even if I am not sure this would be very useful for directory loading,
a solution might be to add another syntax element to invert the filter result.
I'll think about it.

Regards

Re: Filter Fail

I am having another filter problem.
I want to rename a batch of covers each in a separate folder where the folder name is the same as the cover base name.
The filter *\MM2007* or *\\MM2007* should give me just the covers from 3 folders.
I'm getting, instead, all files from those three folders.
I admit I don't quite understand the usage here of the extra \.
But one way or another I should be filtering out any file that doesn't begin with MM2007.
What am I doing wrong?

Re: Filter Fail

Sorry for my late answer.

As previously mentioned, I have found a bug in the filtering mechanism.
The match is not done only on the file name but on the complete path to it too.
Therefore, in your case, if an element of the complete path matches "*\\MM2007*" then
whatever the file name is it will pass the filter.
For example :
C:\MM2007-1\IMG1.jpg
C:\A\Z\MM2007ZTX\HOUSE\IMG2.jpg
will pass the filter because "*\\MM2007*" is in the complete path.

With current Siren version (3.14) the filter "*\\MM2007*\\*MM2007*.jpg" may correspond to your needs.
In the next version (3.15), in which the bug is corrected, only the file name is tested, not its path.
This won't be possible to achieve ...

Re: Filter Fail

I really, really wish you would issue a new version with the filter bugs fixed.

Do you have a work around to find all files which begin with [ in a batch of subdirectories.
[*
/[*
\[*
/\[*
*\\/\[*
*\\*\\/\[*
etc. etc.
Nuthin works. What am I doing wrong here?
After a bit I get totally confused with which /\ means what in which position
How about a straightforward everything in quotes is literal.
With a radio button to limit search to subdirectory contents

10 (edited by daffdaemon 2017-03-31 17:31:57)

Re: Filter Fail

Nevermind... *\[* works

A brief tutorial in use of \ and / would be helpful.