[sweeper] Custom rules to manage recordings

boris

New Member
It will be a very sad day for me when my Humax (not the HDD) dies. Thank you everyone who has contributed to make this site or my Humax so useful.

For all my playing about I can't work out how to test whether a programme (in this case film/drama genre) which is saved in the "My Video" directory is present in another (known Films) folder.
Some films are not only repeated on the same channel, on the +1 version of the channel, but on other channels too. I seem to have this trick of ignoring the repeated record symbol in the EPG column which appears for the first two, or perhaps someone else schedules them from the TV screen without bothing to look whether we already have it (again probably me)!

I have been trying in vain to get fileexists to look for Films / %asfilename: %%candidate:* (without quotes, respaced as it was interpretted as a link).
There are probably multiple things wrong in that statement as I am a noob with Sweeper. What am I doing so very wrong?

I thought I had found how you detect films split by the a 5min news type programme, the ones you show with green interlocking jigsaw pieces, the CRID is the same. I don't know how to test that in Sweeper.
Could you help please?

The biggest problem is going to be detecting different films with the same name, but I thought I might look for a release date. It's unlikely that two films of the same name would be released in the same year. I did happen to find a couple of films like that and they weren't remakes either.

Thank you in advance.
 
As a total newb when it comes to sweeper, I came here with what I thought would probably be a simple request, a rule which would delete any empty folders but having thought about it a bit more I'd like to know if there was a way to do something all together more complicated.

Would it be possible to have a rule which automatically applies auto expire options and ad detection to any folder which is created by series recording?

This would be incredibly helpful if it was possible as at present my house mate, is constantly setting tv shows on series record and leaving watched files on the disk so every now and then I have to go through and set ad detection and then auto expire options on the folders to get rid of any files which have been watched. It's not a huge pain to do that but it would be great to have it done automatically.

Is anyone able to help me out with this?

Thanks
 

MymsMan

Ad detector
As a total newb when it comes to sweeper, I came here with what I thought would probably be a simple request, a rule which would delete any empty folders but having thought about it a bit more I'd like to know if there was a way to do something all together more complicated.

Would it be possible to have a rule which automatically applies auto expire options and ad detection to any folder which is created by series recording?

This would be incredibly helpful if it was possible as at present my house mate, is constantly setting tv shows on series record and leaving watched files on the disk so every now and then I have to go through and set ad detection and then auto expire options on the folders to get rid of any files which have been watched. It's not a huge pain to do that but it would be great to have it done automatically.

Is anyone able to help me out with this?

Thanks
Ad-detection is not a folder option - did you mean auto-decryption?
Recursive auto-decrypt can be set on the My Videos folder to handle dynamically created series folders

You can't, AFAIK, set recursive autoexpire options or set them via Sweeper, but you can use Sweeper to delete watched recording.
Set up a rule that checks for flag not New and age since watched. This rule should delete recordings 24 hours after they have been watched
Code:
# Delete Watched
recurse 1 !flag New wage {> 24} action delete
See the wiki for details of available conditions.

The tidy-folders package will delete empty folders alternatively the Flatten package moves files out of series folders to My Videos and deletes the series folders
 
Last edited:
Nah, I meant Ad detection, at present I can manually add a sweeper rule to individual folders (it's one of the presets within sweeper) but I was hoping to be able to be able to have it set automatically when the humax creates a new folder for a series recording.

I realise I could set auto expire options on the My Video folder but I don't want the same settings on all folders really as there are some where I'd want to keep files even once they've been watched. It would however be great to be able to have it automatically set when the humax creates a new folder for a series recording, and I could manually remove it for the few series I want to keep whereas it would be present on all the others which make up the majority of the scheduled programmes on my hummy.

Just having a look at the wiki, is there any reason there isn't a condition for 'watched'? I'm sure that would very handy in setting up things like I'd like to be able to do.
 
Last edited:

MymsMan

Ad detector
Change the DetectAds Sweeper rule to 'recurse 1' it was made a non recursive rule when Sweeper did not handle file recursion properly - it does now

The New flag is the watched flag.
 

prpr

Well-Known Member
I realise I could set auto expire options on the My Video folder but I don't want the same settings on all folders really as there are some where I'd want to keep files even once they've been watched. It would however be great to be able to have it automatically set when the humax creates a new folder for a series recording, and I could manually remove it for the few series I want to keep whereas it would be present on all the others which make up the majority of the scheduled programmes on my hummy.
That sounds quite dangerous to me. If such a thing did exist, it could conceivably end up re-creating the auto-expire flag on folders which you had removed it from. You'd need a "Never expire" flag rather than the lack of an "Auto Expire" flag to be safer.
 
Change the DetectAds Sweeper rule to 'recurse 1' it was made a non recursive rule when Sweeper did not handle file recursion properly - it does now
Ah, cheers I'll have a look at that, might save me a bit of work.

The New flag is the watched flag.
Must have missed that while having a look, makes sense.


That sounds quite dangerous to me. If such a thing did exist, it could conceivably end up re-creating the auto-expire flag on folders which you had removed it from. You'd need a "Never expire" flag rather than the lack of an "Auto Expire" flag to be safer.
That's a good point, I didn't think of that, makes sense not to be able to do it now you've said that.
 

Luke

Well-Knwοn Мember
Selecting "Sweeper Rules"' from the WebIf OPT+ does not display any preexisting rules if the directory name contains an ampersand. The sweeper display makes it look as though there are no rules set up previously, whether there are pre-existing rules or not. If there are rules then Sweeper's "Text editor" does display the rules.

I was thinking that I had not previously saved the rules until a realised that it was just the display that was not working. When the truncation occurs elsewhere it is immediately obvious what is happening but this one caught me out. As a work round I've renamed the folder and the existing scheduled events folders for series that have an ampersand.
Would it be possible to change this so that the ampersand does not disrupt the display?

I suspect that the cause is similar to Bookmarks' "Back to Media Browser" and Sweeper's "Return to sweeper" button where the ampersand causes truncation of the filename when used as part of the path.
 
OP
af123

af123

Administrator
Staff member
Selecting "Sweeper Rules"' from the WebIf OPT+ does not display any preexisting rules if the directory name contains an ampersand.
This is fixed with the version of Sweeper I've just uploaded, thanks. The other problems relating to the back links will be fixed in the next version of webif.
 

hairy_mutley

Active Member
I have had too much trouble in the past with picture breakup to run AdDetection while recording (even with the CPU limit).
Sweeper provides a convenient sample rule (recursice AdDetect) which I normally keep disabled, but can enable and "Run Now" when the system is not busy (decrypting recordings at the same time).
This is OK, but as far as I can see, there is no way I can create a similar rule to sweep for encrypted recordings to perform decryption.... or am I missing something?
 

Black Hole

May contain traces of nut
You can set a condition to act on a file that is flagged as encrypted. Look for the IF condition "recording flagged as", which defaults to "new", and edit "new" to "encrypted".
 

MymsMan

Ad detector
I have had too much trouble in the past with picture breakup to run AdDetection while recording (even with the CPU limit).
Sweeper provides a convenient sample rule (recursice AdDetect) which I normally keep disabled, but can enable and "Run Now" when the system is not busy (decrypting recordings at the same time).
This is OK, but as far as I can see, there is no way I can create a similar rule to sweep for encrypted recordings to perform decryption.... or am I missing something?
You don't need to decrypt prior to running AdDetect, it will run against encrypted files, there is also now an option (-t hh:mm) where you can specify a run start time so that you could leave the rule enabled and schedule DetectAds to run overnight.
You can set a condition to act on a file that is flagged as encrypted. Look for the IF condition "recording flagged as", which defaults to "new", and edit "new" to "encrypted".
You can check (and set) the encryption flag via Sweeper but 'Decrypt recording' is not currently supported as a Sweeper action so it is not easy to defer decryption to a time when the system is less busy.
 

hairy_mutley

Active Member
You can set a condition to act on a file that is flagged as encrypted. Look for the IF condition "recording flagged as", which defaults to "new", and edit "new" to "encrypted".
That's one half, but it leaves me without any action to perform.

You don't need to decrypt prior to running AdDetect, it will run against encrypted files, there is also now an option (-t hh:mm) where you can specify a run start time so that you could leave the rule enabled and schedule DetectAds to run overnight.
I realise that; I run my "ad-hoc" sweeper rule to peform AdDetect on non-BBC programmes, what I want is a similar way of removing the encryption from the BBC programmes.

I could brush-up on my bash scripting, but is there even a command-line executable that will decrypt a programme?
 

MymsMan

Ad detector
I could brush-up on my bash scripting, but is there even a command-line executable that will decrypt a programme?
auto-decrypt uses the wget command to perform decryption whilst chaseget uses curl (Curl supports restart in mid file).

You could create a sweeper.hook if you wanted to create a new Sweeper action but it might be easier to sweet talk af123.
 

Mark Bowler

New Member
Sorry in advance if any of this has been answered before.
I have a modified version of the de-dup rule that moves the duplicate file to another folder rather than deleting. I have a couple of questions:
  • I'm using the movecreate action to put the duplicate into a folder called "_duplicates". I'd really have liked the folder to be created under the current folder but can't get the syntax right, I thought "./_duplicates" would work but it doesn't and appears to act like "_duplicates" i.e. a folder at the media root.
  • I'd also like to rename the file with the episode title after moving it so when manually checking through the duplicates it is easier to which file is which. So will the renamefile action act on the moved file after it's been moved if I'm in the same ruleset? And additionally what is the result of renaming a file to the name of an existing file, will it fail or add a trailing number ?
 
OP
af123

af123

Administrator
Staff member
I thought "./_duplicates"
Try %folder/_duplicates

So will the renamefile action act on the moved file after it's been moved if I'm in the same ruleset?
No, it won't but if you set the renamefile to be a recursive rule then it should run on the duplicate during the next pass.

And additionally what is the result of renaming a file to the name of an existing file, will it fail or add a trailing number ?
It will fail with a "Target already exists" error.
 
Top