View Issue Details

IDProjectCategoryView StatusLast Update
0000404FileSievePluginpublic2020-01-22 07:46
ReporterBootBlock Assigned ToBootBlock  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version4.41 
Fixed in Version4.50 
Summary0000404: Method: Parent Rename
Description

There's a folder called ContainingFolder which contains a number of video files which are named as follows:~~

  • File One.ext
  • File Two.ext
  • File Three.ext

Within ContainingFolder, create a folder based on the filename then move the appropriate file into the folder that corresponds to it.

While the above will still be supported, it turns out it's wrong. Here's the quote with corrections below:

ContainingFolder\blah 1.txt
ContainingFolder\blah 2.txt
ContainingFolder\blah 3.txt

with no folder in-between.

After the processing it should look like this:

ContainingFolder\blah 1\blah 1.txt
ContainingFolder\blah 2\blah 2.txt
ContainingFolder\blah 3\blah 3.txt

So in effect a folder created from the filename minus the extension after ContainingFolder and then the file placed into it rather than a single folder containing all of the files.

Additional Information

Just need to clarify that I have understood how this works...

Edit: I got it wrong. Description updated.

TagsMethod

Activities

BootBlock

2019-12-14 18:43

administrator   ~0000128

It turns out that I never released a Parent Rename plugin with FileSieve - I could've sworn I had. In fact, checking the source code, while I may have started the plugin, the Process() method (in the programming sense, not FileSieve's Method sense) is completely empty.

The project date stamp for Parent Rename appears to be 2013 (!?), so I wonder if the plugin didn't progress due to a limitation within FileSieve at the time?

BootBlock

2019-12-15 09:37

administrator   ~0000129

The core code is now working!

Next up is to add support for regular expressions and some other options such as only processing the smallest/largest file within a directory.

It seems a bit... odd... that filtering for the smallest/largest/etc file within a directory is left to the Method itself as opposed to the core FileSieve Source Item editor. Methods should only dictate the destination for a processed file, and not which files are processed. This requires big UI and core changes that makes me hesitant due to the possible breaking of existing profiles.

BootBlock

2019-12-15 12:05

administrator   ~0000130

Regular expression support is now in.

Lots of UI polish required, and I think it might be worth adding reg-ex capturing. There are a few places within FileSieve that reg-ex is used, so I think it's probably worthwhile to make a generic reg-ex control so I only need to write the feature once; not sure if this should be done later rather than sooner...

BootBlock

2019-12-15 13:53

administrator   ~0000131

Gaaah, it looks like the regex editor is contained within the FileSieve4.exe assembly and so isn't exposed to plugins as they only reference FileSieve4.Plugins.dll.

Refactoring: required.

BootBlock

2019-12-16 08:09

administrator   ~0000132

Preliminary testing is... good!

FS4-ParentRename.png (17,248 bytes)   
FS4-ParentRename.png (17,248 bytes)   

BootBlock

2019-12-16 08:48

administrator   ~0000133

Oh... uh-oh.

I now remember why I stopped work on the Parent Rename plugin. Damn. Okay.

Parent Rename can match a file via a regular expression, but can also match against the smallest or largest file within a directory - except it can't do the two latter size matches because items are processed in a sequential one-at-a-time. A whole directory isn't passed along and then a plugin can('t) go "Oh, OK; so, we have a list of files within a single directory, so let's pick out the smallest/largest one".

While the plugin can keep a list of each file that was passed along and then determine that said file belongs in a certain directory, there isn't a way for it to know whether the file passed is the last one in the directory or not and then process the directory. That would also be a weird actually-processing-multiple-files-at-once-instead-of-one-at-a-time thing.

FileSieve itself would need a mode for this, but I'm not really sure how to go about it. Maybe pass along a whole directory's contents at a time to a plugin, as opposed to a single file at a time? Hmm, there would need to be a Batched Get Files Mode implemented at some point. Plugins can outline their capabilities, but the user can select the Get Files Mode on a per Source Item basis, so that would have to be overridden.

Oh, man... no wonder I binned this off.

Alright, so the more advanced size stuff can wait and reg-ex matching has to be the main mechanism this works. I'll see if I can think of any other options to add.

Just remembered: the user can set a min/max file size match on a per Source Item basis, so that's... something, I guess?

FS4-ParentRenameNotPossible.png (50,405 bytes)   
FS4-ParentRenameNotPossible.png (50,405 bytes)   

BootBlock

2019-12-17 08:32

administrator   ~0000134

Oops - seemed like I got this wrong. While I personally use a Parent Rename on an almost-daily basis (in a CLI form using a little program I did years ago), it appears the user (hi Jim!) wanted the layout in a different way (description updated accordingly). Thankfully, I'm pretty sure it'll be trivial to add because I'll be going with the Naming Mask approach (eg. %PARENT_NAME%\%FILE_NAME%.%FILE_EXT%) so you can specify exactly how you want things to be laid out and named.

BootBlock

2019-12-21 12:51

administrator   ~0000135

Going to have to leave the Examples (live preview of the current settings) section of the plugin out for now as it's taking forever preparing everything to get it working and delaying the test build.

BootBlock

2020-01-04 16:02

administrator   ~0000140

Will do more work on this plugin in the future.

Issue History

Date Modified Username Field Change
2019-12-14 15:31 BootBlock New Issue
2019-12-14 15:31 BootBlock Assigned To => BootBlock
2019-12-14 15:31 BootBlock Tag Attached: Method
2019-12-14 18:40 BootBlock Summary Method: Parent Rename variation => Method: Parent Rename
2019-12-14 18:43 BootBlock Note Added: 0000128
2019-12-14 18:43 BootBlock Status new => assigned
2019-12-15 09:37 BootBlock Note Added: 0000129
2019-12-15 12:05 BootBlock Note Added: 0000130
2019-12-15 13:53 BootBlock Note Added: 0000131
2019-12-16 08:09 BootBlock Note Added: 0000132
2019-12-16 08:09 BootBlock File Added: FS4-ParentRename.png
2019-12-16 08:48 BootBlock Note Added: 0000133
2019-12-16 08:48 BootBlock File Added: FS4-ParentRenameNotPossible.png
2019-12-17 08:32 BootBlock Note Added: 0000134
2019-12-17 08:34 BootBlock Description Updated
2019-12-17 08:34 BootBlock Additional Information Updated
2019-12-17 08:35 BootBlock Description Updated
2019-12-21 12:51 BootBlock Note Added: 0000135
2020-01-04 16:02 BootBlock Status assigned => closed
2020-01-04 16:02 BootBlock Resolution open => fixed
2020-01-04 16:02 BootBlock Note Added: 0000140
2020-01-22 07:46 BootBlock Fixed in Version => 4.50