The information in this thread is now out of date with the introduction of the new Sweeper package with web-based configuration. Please refer to the new thread at http://hummy.tv/forum/threads/sweeper-custom-rules-to-manage-recordings.5138/
Sweeper is a package which keeps an eye out for new recordings and files them away automatically for you according to specified criteria. It works for both single one-off recordings which appear at the top level of the My Video tree and series recordings that appear in folders.
At present configuration is manual via a file at /mod/etc/sweeper.conf which will appear in the quick-edit list under Diagnostics->File Editor in the web interface.
The configuration file contains a list of rules, one per line. Each rule list a number of conditions followed by an action to be taken if all conditions are true. A rule which contains only an action is always processed. Rules are processed in order until an action is taken.
Some examples will hopefully make it clearer.
The most commonly requested case - just file all one-off recordings into a folder.
This will only work if "archive/miscellaneous" already exists. Changing move to movecreate will cause the folder to be created if necessary.
Here's the configuration file I'm using. It files anything recorded on a children's channel into Children/miscellaneous and everything else into _misc. I use the underscore prefix to put the folder at the bottom of the list. You only need to put quotes around the directory name if it contains spaces.
and here's a bigger made-up example. The configuration file can contain comments prefixed with a # character.
For an up-to-date and maintained list of the available actions, criteria and tokens, please see http://wiki.hummy.tv/wiki/Sweeper
The available actions are:
The available criteria are:
It is possible to use some special tokens in the folder name supplied to move and movecreatewhich are replaced by values from the recording being handled. These tokens are:
Folder Rules
Folder rules are similar to rules for single recordings but are prefixed with the word folder and there are some additional actions that can be taken.
This example replicates the behaviour of the old series-filer package
Whenever a new folder appears due to a series recording, this rule automatically moves any recordings within it to a folder of the same name elsewhere in the tree if one is found. That means that you can file away series folders in a more structured way and any new episodes will follow them.
You can use the same criteria as for single recordings so if you wanted all children's series to end up under Children/ you could do:
That causes the Children folder to be searched for a folder that matches the new series. If it is found, the new recordings are moved into it but if not then a new folder is created under Children (that's the create part of the action).
Sweeper hooks into automatic processing so actions and diagnostic information will be recorded in auto.log. Increasing the automatic processing debug level will log more information.
Sweeper is a package which keeps an eye out for new recordings and files them away automatically for you according to specified criteria. It works for both single one-off recordings which appear at the top level of the My Video tree and series recordings that appear in folders.
At present configuration is manual via a file at /mod/etc/sweeper.conf which will appear in the quick-edit list under Diagnostics->File Editor in the web interface.
The configuration file contains a list of rules, one per line. Each rule list a number of conditions followed by an action to be taken if all conditions are true. A rule which contains only an action is always processed. Rules are processed in order until an action is taken.
Some examples will hopefully make it clearer.
The most commonly requested case - just file all one-off recordings into a folder.
Code:
action {move "archive/miscellaneous"}
This will only work if "archive/miscellaneous" already exists. Changing move to movecreate will cause the folder to be created if necessary.
Here's the configuration file I'm using. It files anything recorded on a children's channel into Children/miscellaneous and everything else into _misc. I use the underscore prefix to put the folder at the bottom of the list. You only need to put quotes around the directory name if it contains spaces.
Code:
lcn {>= 70} lcn {<= 79} action {move Children/Miscellaneous}
action {move _misc}
and here's a bigger made-up example. The configuration file can contain comments prefixed with a # character.
Code:
# Sweep single Big Bang episodes into the series folder
lcn 4 title "Big Bang" action {move "The Big Bang Theory"}
# Don't touch anything from channel 78 over 20 minutes long
lcn 78 duration {>= 21} action preserve
lcn {>= 70} lcn {<= 79} duration {> 20} schedduration {>= 10} title {Kairu} synopsis {Team Hiverax} definition SD size {> 1024} genre Children action {move Children/Miscellaneous}
title {Mother} action {move "Test \"2\""}
title {Greatest} action {movecreate "_misc"}
For an up-to-date and maintained list of the available actions, criteria and tokens, please see http://wiki.hummy.tv/wiki/Sweeper
move - move the recording to a folder.movecreate - move the recording to a folder and create it if it doesn't exist.fileunder (folders only) - look for another existing with the same name as the new series recording and, if found, move the new recordings into it.fileundercreate (folders only) - As fileunder but if no folder is found then create a new one.preserve - do nothing and stop processing rules.
flag - a flag against the recording, e.g. 'flag New'. Flags are Locked, New, Encrypted, Guidance, ODEncrypted, Shrunk, Deduped.lcn - channel number, e.g. 'lcn 1', 'lcn {> 1}'duration - recording duration in minutes, e.g. 'duration {> 60}'schedduration - scheduled recording duration in minutes.size - size in bytesage - age in hourswage - number of hours since last watcheddefinition - standard (SD) or high (HD) definition, e.g. 'definition SD'title - title contains ..., e.g. 'title {The Big Bang Theory}'synopsis - synopsis contains ...guidance - guidance contains ...genre - recording genre is.. e.g. 'genre Children'hour - hour of recording, e.g. 'hour {>= 21}'lock - always matches but changes the lock status of the recording as a side-effect. Use 'lock 1' to lock and 'lock 0' to unlock.
%genre%definition%title%channel%lcn%duration%timestamp
Code:
action {move %title}
Folder Rules
Folder rules are similar to rules for single recordings but are prefixed with the word folder and there are some additional actions that can be taken.
This example replicates the behaviour of the old series-filer package
Code:
folder action {fileunder ""}
Whenever a new folder appears due to a series recording, this rule automatically moves any recordings within it to a folder of the same name elsewhere in the tree if one is found. That means that you can file away series folders in a more structured way and any new episodes will follow them.
You can use the same criteria as for single recordings so if you wanted all children's series to end up under Children/ you could do:
Code:
genre {Children} action {fileundercreate "Children"}
That causes the Children folder to be searched for a folder that matches the new series. If it is found, the new recordings are moved into it but if not then a new folder is created under Children (that's the create part of the action).
Sweeper hooks into automatic processing so actions and diagnostic information will be recorded in auto.log. Increasing the automatic processing debug level will log more information.