• The forum software that supports hummy.tv has been upgraded to XenForo 2.3!

    Please bear with us as we continue to tweak things, and feel free to post any questions, issues or suggestions in the upgrade thread.

[sweeper] Custom rules to manage recordings

On a different issue to above, could sweeper be used as an alternative to newk? If there was a 'filename starts with' condition in addition to the existing 'filename contains' condition, along with an action along the lines of 'strip this from start of file and media list name' then I reckon it would.
 
I'm wanting to move all of my radio recordings into one folder and then just copy them across to my PC after the Humax has done it's thing.

I've read through the Sweeper thread and Wiki page and think I've got the rules right but don't want to make the rules live until they have been checked.

Example of what I want to do

Radio Recordings on the Humax:

Clare in the Community/
The Reunion/
Sketchorama/

Move all of files in the above folders to a folder called Radio Recordings/

Then rename all the files in Radio Recordings to the format: yyyyy mm dd - title

Please let me know if the following rules will accomplish the above.

Sweeper Rules.png
 
I'll have to admit defeat, I set a few recordings to test out my rules I can get the rename to work on the root folder but not on the Radio Recordings files.

Hopefully someone with more knowledge of Sweeper can help me set up the rules to work.
 
I think you want to be applying the last rule (the rename one) on the Radio Recordings folder as a separate sweeper rule rather than on My Video. The 'If' condition will fail and find nothing because it is testing against the 'My Video' folder name - in fact I can't see how it can ever match anything other than the folder name that the rule belongs to, and therefore seems redundant unless I'm misunderstanding what it means in this context.
 
I think you want to be applying the last rule (the rename one) on the Radio Recordings folder as a separate sweeper rule rather than on My Video. The 'If' condition will fail and find nothing because it is testing against the 'My Video' folder name - in fact I can't see how it can ever match anything other than the folder name that the rule belongs to, and therefore seems redundant unless I'm misunderstanding what it means in this context.

Tried that but the files don't get renamed.

Also tried adding a Shrink & Decrypt to the Radio Recordings folder but only 1 recording was processed.
 
I'll have to admit defeat, I set a few recordings to test out my rules I can get the rename to work on the root folder but not on the Radio Recordings files.

I would set up the re-name rules in a sweeper file attached to the Radio Recordings folder itself. (Go to the Radio Recordings folder, click OPT+, choose Sweeper Rules)

A simple rule placed in a sweeper file attached to the Radio Recordings folder saying:

Always Rename recording files to %year %2digitdate %2digitmonth - %title

should do what you want. This will only rename the files, but leave the Media List title untouched.

re: Shrink and Decrypt: Go to Diagnostics page, click on auto.log to get more info on what's happening with auto-processing.
 
I would set up the re-name rules in a sweeper file attached to the Radio Recordings folder itself. (Go to the Radio Recordings folder, click OPT+, choose Sweeper Rules)

A simple rule placed in a sweeper file attached to the Radio Recordings folder saying:

Always Rename recording files to %year %2digitdate %2digitmonth - %title

should do what you want. This will only rename the files, but leave the Media List title untouched.
I already did that see my reply above.

It didn't work.
 
I already did that see my reply above.
It didn't work.

Sweeper is part of the auto-processing sequence which works at 10 minute intervals, so it can take between 1-9 minutes for your rules to be activated after you have saved them.

If you want your rules to be applied immediately, go to Diagnostics page, and type ' sweeper/test ' in the Diagnostics box, then click 'Run Diagnostic'.

If, despite a short wait or running 'sweeper/test', it's still not working then did you include a condition of any kind in the rule?

If you click on 'View Config' or 'Toggle raw display' in the sweeper file attached to your Radio Recordings folder, the code should read something like:

# Rename files
action {renamefile {%year %2digitmonth %2digitdate - title}}

If you have something different then post it up and we can troubleshoot more precisely.

You can also click on 'Test config' to see what would happen if the rule were applied, which might reveal to you the reason why it is not working.
 
On a different issue to above, could sweeper be used as an alternative to newk? If there was a 'filename starts with' condition in addition to the existing 'filename contains' condition, along with an action along the lines of 'strip this from start of file and media list name' then I reckon it would.

Newk works on folder names, not on file names - so sweeper is more of an addition than an alternative :)

Are you thinking of something for sweeper that would work universally on all files?
You can already use sweeper for nuking new prefixs from filenames, though not generically, only on specific folders containing one series - e.g.

#For Big Bang Theory episodes
# Remove 'New' tag from start of Media List Titles
title New: action {settitle {The Big Bang Theory}}
# Remove 'New' tag from start of file names
filename New_ action {renamefile %title_%yyyymmdd_%hhmm}}


 
I haven't been able to make successful sweeper rules using the 'scheduled duration' criteria.

'Recording duration' seems to work as a criteria but not 'scheduled duration'.
 
Are you thinking of something for sweeper that would work universally on all files?


Yes, something along the lines of 'Super Sweeper', 'Sweeper Pro' (you get the idea :) ), which could traverse the entire folder structure from My Video downwards (unless it finds a .nosweep folder) and either rename files and/or folders (including Media List titles) as per universal rules to add tags etc. (as per your previous examples), or else remove prefixes a la Newk .
 
Sweeper is part of the auto-processing sequence which works at 10 minute intervals, so it can take between 1-9 minutes for your rules to be activated after you have saved them.

If you want your rules to be applied immediately, go to Diagnostics page, and type ' sweeper/test ' in the Diagnostics box, then click 'Run Diagnostic'.

If, despite a short wait or running 'sweeper/test', it's still not working then did you include a condition of any kind in the rule?

If you click on 'View Config' or 'Toggle raw display' in the sweeper file attached to your Radio Recordings folder, the code should read something like:

# Rename files
action {renamefile {%year %2digitmonth %2digitdate - title}}

If you have something different then post it up and we can troubleshoot more precisely.

You can also click on 'Test config' to see what would happen if the rule were applied, which might reveal to you the reason why it is not working.

After adding the folder rule I waited for about 2 hours.

Shrink & Decrypt worked on 1 file but neither file was renamed.

I will try again when I have a few new radio shows to try it out on.

Is there any way to automatically delete the empty folders once the files have been moved to the main Radio Recordings folder?
 
You might be going about this the wrong way.

The original intention of sweeper was to do something with the non-series and flattened recordings that end up under My Video. flatten moves series recordings from their host folder into My Video, and deletes the host folder (flatten can be disabled on selected folders).

Thus you could be running flatten, and then using sweeper to selectively tidy things away when they arrive in My Video. Any auto-processing you then wanted to perform on recordings would be done in the destination folder rather than the original folder.
 
Thus you could be running flatten, and then using sweeper to selectively tidy things away when they arrive in My Video. Any auto-processing you then wanted to perform on recordings would be done in the destination folder rather than the original folder.

That makes sense, but isn't one issue that until the destination folder has been created you can't create a sweeper rule for it to do any extra auto processing (from the webif at least), because sweeper rules are on a per-folder basis? What would be ideal is if any one sweeper rule could perform multiple actions in the same way that it accepts multiple conditions e.g. move a file to a new folder somewhere else and then rename it. I'm still trying to understand all the capabilities of sweeper, and maybe it can already do this.
 
Is there any way to automatically delete the empty folders once the files have been moved to the main Radio Recordings folder?

I run a little script called 'Tidy' that I knocked up every 5 minutes - seems to do the job.

Code:
*/5 * * * * /mod/bin/tidy >> /mod/tmp/tidy.log 2>&1


Code:
#!/bin/sh
 
ECHO=/mod/bin/busybox/echo
RM=/mod/bin/busybox/rm
WC=/mod/bin/busybox/wc
LS=/mod/bin/busybox/ls
RM=/mod/bin/busybox/rm
MV=/mod/bin/busybox/mv
TAIL=/mod/bin/busybox/tail
ROOT="/media/My Video"
 
IFS=$'\n'
 
for d in $ROOT/*; do
    if [ -d $d ]; then
            filecount=`$LS $d | $WC -l`
            if [ $filecount -eq 0 ]; then
                $ECHO "Deleting empty folder - $d"
                $RM -r $d
            fi
    fi
done
 
$TAIL -c 1000 /mod/tmp/tidy.log > /mod/tmp/tidy.tmp
$MV /mod/tmp/tidy.tmp /mod/tmp/tidy.log
 
$ECHO "Finished"
 
That makes sense, but isn't one issue that until the destination folder has been created you can't create a sweeper rule for it to do any extra auto processing (from the webif at least), because sweeper rules are on a per-folder basis?
I don't get you. The target folders have to be pre-created, and marked no-flatten (ether with a flag or by starting the name with "["). You would do this when setting up a series recording in the first place.
 
I seem to be able to set rules in Sweeper to process files that have a negative age (e.g. 'Age < -1'). Does this mean I can speculatively move a recording before it has been created? :)
Wow - already people are using this in ways I never thought possible! Now where's the sarcasm smiley? : )
As far as the web interface is concerned, it's just an integer comparison condition. I could enforce limits but that one will just never match.
 
On a different issue to above, could sweeper be used as an alternative to newk? If there was a 'filename starts with' condition in addition to the existing 'filename contains' condition, along with an action along the lines of 'strip this from start of file and media list name' then I reckon it would.
It could be used to supplement newk. Newk doesn't act on files, it changes the schedule for series recordings that would include the New: prefix when creating folders.
 
I think you want to be applying the last rule (the rename one) on the Radio Recordings folder as a separate sweeper rule rather than on My Video. The 'If' condition will fail and find nothing because it is testing against the 'My Video' folder name - in fact I can't see how it can ever match anything other than the folder name that the rule belongs to, and therefore seems redundant unless I'm misunderstanding what it means in this context.
It's useful for folder rules.

Normal rules just act on single recordings in the folder being scanned;
Folder rules act on all sub-folders within the folder being scanned but (at the moment) only if they were created automatically due to a series recording.
 
Back
Top