Reset command for content plugins (MRT improvement)
Posted: 2014-03-10, 18:05 UTC
There are a lot of recent suggestions to improve MRT counters. It is impossible to put them all into single MRT. I have a quite-easy-to-realize idea. Currently WDX plugins can't be used for MRT counters because they don't know when they should start to count or reset counter when TC creates list of resulting names in MRT or updates it.
Idea is to request special 'ResetCounters' content field from every WDX plugin (that report supporting of such feature via ContentGetSupportedField) before updating MRT filenames list or before starting rename operation. This field shouldn't return any result but every plugin on such field request should reset its internal state so its normal fields would produce same value sequences after each reset.
Such feature would allow creating absolutely any kind of counters for MRT: cyclic, per-folder dependent, incremented by N every M files, with numbers (including exact bands), letters, words, counting from '10' to '15, counting from 'x' to 'z', etc etc etc. Every plugin counter may provide large number of positions (using units '0', '1', '2', '3' etc) so it will be possible to increment next position value on overflow (e.g. you could use [=myplug.counter2.1][=myplug.counter1.0] where counter1 counts from 'a' to 'c' and counter2 counts from '0' to '3', and resulting sequence after reset would be "0a", "0b", "0c", "1a", "1b", "1c" etc).
So I repeat: the only thing TC have to do is to request 'ResetCounters' field (or suggest a better name) from every WDX plugin [that supports this feature] before generating list of filenames in MRT. The rest will be done by plugin writers.
Probably it will have sense to call such field for retrieving fields in regular panels after changing folder (this will allow fields with e.g. accumulative sums of sizes).
Idea is to request special 'ResetCounters' content field from every WDX plugin (that report supporting of such feature via ContentGetSupportedField) before updating MRT filenames list or before starting rename operation. This field shouldn't return any result but every plugin on such field request should reset its internal state so its normal fields would produce same value sequences after each reset.
Such feature would allow creating absolutely any kind of counters for MRT: cyclic, per-folder dependent, incremented by N every M files, with numbers (including exact bands), letters, words, counting from '10' to '15, counting from 'x' to 'z', etc etc etc. Every plugin counter may provide large number of positions (using units '0', '1', '2', '3' etc) so it will be possible to increment next position value on overflow (e.g. you could use [=myplug.counter2.1][=myplug.counter1.0] where counter1 counts from 'a' to 'c' and counter2 counts from '0' to '3', and resulting sequence after reset would be "0a", "0b", "0c", "1a", "1b", "1c" etc).
So I repeat: the only thing TC have to do is to request 'ResetCounters' field (or suggest a better name) from every WDX plugin [that supports this feature] before generating list of filenames in MRT. The rest will be done by plugin writers.

Probably it will have sense to call such field for retrieving fields in regular panels after changing folder (this will allow fields with e.g. accumulative sums of sizes).