Topic: Opinion on new feature : expression filters

Hello,

I am planning to add a new feature to Siren and I would like your opinion about it.

Here is the problem :
1) I have a folder containing different types of file : music and video
2) I want to rename all the files following different patterns based on their types/names
3) With current Siren version two batch steps are necessary. One for each file type (select the files, choose an expression and rename)   

To limit the work the idea is to be able to make an expression "file filter aware".

As you may know a rename expression can be composed of different sub-expressions separated by ';'.
Prefixing each sub-expression with a file filter could do the job. File filters could be enclosed in "[]".
For example :
[*.jpg]Photo_%f;[*.avi]Video_%f
or more complicated
[*.jpg;*.nef]%Xdo_%f;[[A-M]*.avi;[A-M]*.mpeg]AAA_%dm_%f;[[N-Z]*.avi;[N-Z]*.mpeg]ZZZ_%dm_%f;[*.mp3]%Aa - %At.%e
   
What this last expression will do :
1) %Xdo_%f will be applied only to *.jpg and *.nef selected files
2) AAA_%dm_%f will be applied only to *.avi and *.mpeg selected files with current names starting with a letter between 'A' and 'M'
3) ZZZ_%dm_%f will be applied only to *.avi and *.mpeg selected files with current names starting with a letter between 'N' and 'Z'
3) %Aa - %At.%e will be applied only to *.mp3 selected files

Notes :
- Any file matches an empty filter. This makes this feature backward compatible 
- The sub-expressions are not exclusives. If a file pass a filter the associated sub-expression is applied to it.
  For example, this expression will prefix all names with the modification date : [*.jpg]Photo_%f;[*.avi]Video_%f;%dm_%f
- This feature can be seen too as a simplified "if"
- I know it will only be used by a few power users sad

For now I have not fixed all details and anything can be changed.

Regards

Remi

Re: Opinion on new feature : expression filters

? Did I really have missed this post? Sorry for late responce ;-)

Looks fine. Good idea.

-------------------------------------------------------

While touching about an use, I was thinking about a folder full of MP3s and one or more album cover JPGs.
This new filter will allow me to rename e.g. the JPGs by the parent folder name, without utilizing the Filter combobox by hand.
[*.jpg]%p%ncs.%e

Add timestamp to filename; with exif date for jpg and file creation date for mp4:
[*.jpg]%Xdo_%f;[*.MP4]%dc_%f

Explanations for other readers:
[*.jpg] work only on JPG files (not implemented yet)
%p   parent directory
%n   the selection number
%nc  the selection number relative to a name "collision"
%ncs same principle as "%nc" except that it is empty for the first element of the "collision group" and prefixed by a "_" for the others.
%Xdo EXIF DateTimeOriginal
%dc the creation date and time


-------------------------------------------------------

Ideas:

- first I thought, why not dropping the leading "*." part, it is superfluous, and maybe use a space as seperator,
like just [jpg nef png] instead of [*.jpg;*.nef;*.png]
But your origin idea fits better along with the command line "/S" parameter.

- invent filetype groups to use as filter: [Image] = png jpg jpeg bmp, [Video] = avi mpeg , [Audio] = wav mid mp3
[Image]Photo_%f;[Video]Video_%f

- Will this work: exif date for jpg, creation date for ALL *.* others (but NOT for jpgs)
[*.jpg]%Xdo_%f;[*.*]%dc_%f

-------------------------------------------------------

Will you expand this filter feature in future?  big_smile

Just see if the expression inside the [ ] can evaluated to true.

[JPG && (%Ix -lt 100 || %Iy -lt 80)]thumbnail_%f
[%N]_numberfound_%f

-------------------------------------------------------

Re: Opinion on new feature : expression filters

Hello Stefan,

Thanks a lot for your feedback.

Stefan wrote:

- first I thought, why not dropping the leading "*." part, it is superfluous, and maybe use a space as seperator,
like just [jpg nef png] instead of [*.jpg;*.nef;*.png]
But your origin idea fits better along with the command line "/S" parameter.

I would like to keep the "file filter" notion consistent all accros Siren : command line, filter combobox, search/selection filter ...

Stefan wrote:

- invent filetype groups to use as filter: [Image] = png jpg jpeg bmp, [Video] = avi mpeg , [Audio] = wav mid mp3
[Image]Photo_%f;[Video]Video_%f

Maybe, but not for the first version.

Stefan wrote:

- Will this work: exif date for jpg, creation date for ALL *.* others (but NOT for jpgs)
[*.jpg]%Xdo_%f;[*.*]%dc_%f

No. If a file passes a filter (an empty filter is equivalent to "*.*" or "*") then the sub-expression is applied to it.
This can solved with unperfect workarounds like :
[*.jpg]@%Xdo_%f;[[!@]*]@%dc_%f;%f(2)
or
[*.jpg]%Xdo_%f;[*.[!j]??;*.?[!p]?;*.??[!g]]%dc_%f

Stefan wrote:

Will you expand this filter feature in future?  big_smile

Why not. It depends on the users needs (and I am part of them) and my available work time for it.

Just another relatively important change that I would like to do : the removal of the disk change monitoring feature.
Siren 3.14 tracks the modifications done to its current directory by other programs and reflect the changes in its file list.
This feature can be handy but it is heavy, sometimes not reliable and doesn't work in some cases.
What is your opinion about this step backwards ?

4 (edited by Stefan 2014-08-14 18:31:32)

Re: Opinion on new feature : expression filters

Rémi wrote:
Stefan wrote:

- Will this work: exif date for jpg, creation date for ALL *.* others (but NOT for jpgs)
[*.jpg]%Xdo_%f;[*.*]%dc_%f

No. If a file passes a filter (an empty filter is equivalent to "*.*" or "*") then the sub-expression is applied to it.

Ahh, OK.

But on an second thought:

%dc_%f;[*.jpg]%Xdo_%f

smile



Just another relatively important change that I would like to do : the removal of the disk change monitoring feature.
Siren 3.14 tracks the modifications done to its current directory by other programs and reflect the changes in its file list.
This feature can be handy but it is heavy, sometimes not reliable and doesn't work in some cases.
What is your opinion about this step backwards ?

Thanks for asking. I need time to think about it. Tomorrow...



- - -

5 (edited by Stefan 2014-08-14 18:31:54)

Re: Opinion on new feature : expression filters

Rémi wrote:

Just another relatively important change that I would like to do : the removal of the disk change monitoring feature.
Siren 3.14 tracks the modifications done to its current directory by other programs and reflect the changes in its file list.
This feature can be handy but it is heavy, sometimes not reliable and doesn't work in some cases.
What is your opinion about this step backwards ?

Today I get it.
>>Siren tracks the modifications done to its current directory by other programs

You don't mean own modifications by renaming, but really modifications by other programs?

I think, own modifications should be seen immediately.
For modifications done by other programs it would be enough *for me* to just press F5 from time to time. (on Win32)

But maybe, since you have the code already, just make it optional in the settings and disable it on default.

Re: Opinion on new feature : expression filters

Hi,

Thanks for your answer.
In my development version I have already added an option to enable/disable it and an information on the screen to show its current state. But I don't feel it right to be there and uselessly complicating the things.

I am sorry for the antispam system but there is a huge number of fake users creation attempts every day.
Some pass through the filters and it is a pain to have to keep an eye on that ...
I'll try to have a look at the problems you had.

Re: Opinion on new feature : expression filters

Hello Rémi,

I just discover this threat with your answer to my last post.

If it's not too late, let me add my  thought about this idea. Your idea just fill the need
I have!
I use Siren to copy my camera's memory card to my hard disk and orginize the
files "on the fly" putting them in the right place. The problem I have is I shoot in RAW
+ JPEG and some time did movies too; so on the memory card I have 3 kinds of file
I want to separate on the hard disk. I now use 3 favorites expressions and 3 file filters.

With the "expression filter" I can manage all of them with only 1 expression! Great.

May I just suggest to add a negation of the expression filter; i.e. [! *.jpg] to match all except
the file pattern. The case from Stefan would be simply written:
    [*.jpg]%Xdo_%f;[! *.jpg]%dc_%f

Re: Opinion on new feature : expression filters

For now, in 3.15, the filter syntax won't be changed to "respect" the standard.
Therefore only a set of characters can be forbidden.
So the expression could be written : [*.jpg]%Xdo_%f;[ *.[!j][!p][!g]]%dc_%f