[sweeper] Custom rules to manage recordings

Sweeper rules for the top level folder-directory appear in /mod/etc/sweeper.conf, but where do the Sweeper rules for sub-folders appear?

(I have some rules created with the help of the webif GUI, however now I'd like to copy and paste them onto different sub-folders and between HDRs, and it seems the quickest way to do it would be in the File Editor, if I could access the relevant files)
 
They are a '.sweeper' file in the folder in question. I used samba to copy rulrs from one folder to another. Very useful

Sent from my GT-I9505 using Tapatalk
 
Thank you! Two different options!

That's so useful - now I have three different ways to create and attach rules :)

The Wiki's analogy of Sweeper as Swiss Army Penknife is very apt.
 
I've set up some sweeper rules for re-naming recordings:

!title 201 action {settitle %title_%yyyymmdd}

or

!title 201 action {renamefile %yyyymmdd_%hhmm_%title}

which have been well received by the household, but inevitably, the ever-demanding require even more .... "can't it do the day as well please?" :rolleyes:

Specifically, the feedback I've received, on my sweeper rules re-titles, is that while:

EastEnders_20140616
EastEnders_20140617
EastEnders_20140618

is a bit more useful than:

EastEnders
EastEnders
EastEnders

the date number is always visible anyway, and its the day info that's also important, so it would be more user friendly to see:

EastEnders_Mon 16 Jun 2014
EastEnders_Tue 17 Jun 2014
EastEnders_Wed 18 Jun 2014

So I had a look ....
In the on-TV Media List, the 'File Information' panel reads (for example)

7 BBC THREE
EastEnders
FRI 20 JUN 22:30 ~ 23:00
Drama

Most of these details are already tokens:

7 = %lcn (Logical channel number)
BBC THREE = %channel (Channel name)
EastEnders = %title (Recording title)
Drama = %genre (Recording genre)

So would it be possible to have the remaining info: 'FRI' '20' 'JUN' and '22:30 - 23:00' tokenised too?

As well as %yyyymmdd, to have %day, %date, %month, %year
- or something similar?
 
Thank you! Two different options!
That's so useful - now I have three different ways to create and attach rules :)
I'll add a button to the sweeper pages that takes you straight over to the file editor too so you can paste rules in. All bases covered!
 
Isn't this going to mess up your sort sequence when you subsequently view your list of recordings?
Fair point but no .... because the Media List Title and the file names can be different.

!title 201 action {renamefile %title_%yyyymmdd_%hhmm_%shortday %date %shortmonth}
!title 201 action {settitle %title_%shortday %date %shortmonth %year}

The Media List Titles are for the on-TV view where the HDR shows them chronologically by default.

The file names viewable by other means, e.g. Samba, can be named differently with the %yyyymmdd used to organise them chronologically.

For something like EastEnders, choosing which one to watch, from the list on the TV screen, often seems to focus on the day - "I didn't see Monday's, which one's Monday's?"
Particularly for those with 'pre-war vintage' eyes, '20140616' appears like one of those confusing Captcha codes (even more so when viewed on a 15 inch screen - but that's another story!) whereas 'Mon 16 Jun' is much more user friendly.

However if one wanted the Media List Title and the file names to match, then it would be possible to do:

!title 201 action {renamefile %title_%yyyymmdd_%hhmm_%shortday %date %shortmonth %year}
!title 201 action {settitle %title_%yyyymmdd_%shortday %date %shortmonth}

or

!title 201 action {renamefile %yyyymmdd_%hhmm_%title_%shortday %date %shortmonth}
!title 201 action {settitle %yyyymmdd_%hhmm_%title_%shortday %date %shortmonth}

But the unavoidable issue is that Media List Titles have a fixed and limited length, so if its a long programme name, you either have to limit the added tokens or abbreviate the programme name to fit, hence I opted for 'Title_Day Date Month Year' ;)

[EDIT] I have updated the above code examples with the actual new tokens that af123 created (so as not to confuse anyone who may read this in the future)
 
Sweeper 2.0.4 has a new Text Editor button below the rules and has some new tokens - see http://wiki.hummy.tv/wiki/Sweeper#Tokens
CF was already amazing in its processes and functionality and then ... along came Sweeper!
Automates so many things, saves so much time - and always gets it right - (unlike feeble fallible humans who mis-file things and mis-type dates)

The new Sweeper tokens have been put into action - they are so useful - many, many thanks af123.
And very well received by the household. "Just genius" was one of the comments :)

One more thought ... related to HarveyB's above question.
I've been pondering on %date and %month - I like them appearing 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 etc. Suits me perfectly. Makes it simple to automate 'Sun 6 Mar' , or 'Tuesday 8 November'.

However I wonder if there might be some people who would want double digit numbering as well, for numerical dates and months - 01, 02, 03, 04, 05, 06, 06, 07, 08, 09, 10 - to keep things chronologically ordered.

Is there any mileage in having tokens for %2digitdate and %2digitmonth also? So that 2014-06-28 would be possible?

Or is that making it too complicated?
 
There's no real overhead in having tokens there so I'll add those too. Might as well chuck %2digityear into the mix while I'm on.

Did you spot the new lastrule condition? For your example a couple of posts ago, you could use it to chain the second action onto the first rule. Not really a saving since you only have a single simple condition but would probably serve as a better example. Would you mind posting your final configuration? Thanks.
 
There's no real overhead in having tokens there so I'll add those too. Might as well chuck %2digityear into the mix while I'm on.
Good stuff! Thank you.

Yes, %2digityear makes sense, to complete the set.

Did you spot the new lastrule condition? For your example a couple of posts ago, you could use it to chain the second action onto the first rule.

I had spotted it ... but hadn't used it yet :oops: Let's give it a go! ...

Here's my earlier version of some generic rules to rename a series of programmes in more user-friendly style:

#Re-name recording's files
!title 201 action {renamefile %title_%yyyymmdd_%hhmm_%shortday %date %shortmonth %year}
#Re-name Media List title
!title 201 action {settitle %title_%shortday %date %shortmonth %year}

(Filenames re-named to work in alphanumeric order, and Media List titles changed to be neat and user friendly on TV screen, plus the 'if the Media List Title doesn't contain a year' condition to stop it endlessly re-naming)

A more refined version of this, using lastrule, works equally well :)

#Re-name recording's files (format: ProgrammeName_20140625_1130_Wed 25 Jun 2014)
!title 201 action {renamefile %title_%yyyymmdd_%hhmm_%shortday %date %shortmonth}
#Re-name Media List title (format: ProgrammeName_Wed 25 Jun 2014_11:30)
lastrule "" action {settitle %title_%shortday %date %shortmonth %year_%hh:%mm}

Would you mind posting your final configuration?

No probs. The one I used most is above.

Here's another slightly more sophisticated one (newly spruced up with lastrule) to corral all manner of random Archers recordings into one place, to tame the titles so they appear user-friendly in chronological order and then move them off the HDR.

First some rules from the top-level Sweeper config to get both one-off and series recordings in one place:

# Move single one-off Archers recordings into appropriate folder
title Archers action {movecreate 03_RADIO/The Archers}
# Tidy new Archers folders into appropriate folder
folder title {The Archers} action {fileundercreate 03_RADIO}

Then Sweeper rules for re-naming, attached to the sub-folder:

# Re-name Archers recording files (format: The Archers_20140622_1901_Sun 22 Jun 2014)
!title 201 duration {< 25} action {renamefile {The Archers_%yyyymmdd_%hhmm_%shortday %date %shortmonth %year}}
# Re-name Archers Media List titles (format: The Archers_Sun 25 Jun 2014_19:01)
lastrule "" action {settitle {The Archers_%shortday %date %shortmonth %year_%hh:%mm}}
# Re-name Archers Omnibus recording files (format: The Archers_20140622_1000_Omnibus_Sun 22 Jun 2014)
!title 201 duration {>= 25} action {renamefile {The Archers_%yyyymmdd_%hhmm_Omnibus_%shortday %date %shortmonth %year}}
# Re-name Archers Omnibus Media List titles (format: The Archers Omnibus_Sun 22 Jun 2014_10:00)
lastrule "" action {settitle {The Archers Omnibus_%shortday %date %shortmonth %year_%hh:%mm}}

Then finally to sweep the files elsewhere:

# Move to USB any decrypted and shrunk recordings that are more than a week old
age {> 170} !flag ODEncrypted flag Shrunk action {movecreate {/media/usb-drive1/B_Archers catch-up}}

Looks complicated, but is actually easy and quick to set-up, then all automated, 'set-and-forget' ... lovely stuff ... :D
 
Hiya

Been using Sweeper to move films to a films folder for a while now which works very nicely indeed and having seen that there have been huge developments and a GUI I thought I'd have a go at setting up a few more rules but I'm a little unsure about exactly what I'm doing.

One I'd like to set up is on for a particular folder and I'd like any programmes to be deleted a week after they have been watched.

I get that I setup the condition so "if folder = Ghost Adventures"

but what condition do I set just for watched programmes? I see there is one for age since watched or recorded but I want unwatched programmes to stay indefinitely, it's only the watched ones I want deleted after a week...

Any help much appreciated.
 
Cool, thanks I'll have a look at that if I can get Web If loading again which it doesn't want to do at the moment... Odd was fine earlier!
 
but what condition do I set just for watched programmes?
As BH says, auto-expire will do this but the Sweeper condition would be 'Recording not flagged as New.'

Screenshot%202014-06-28%2011.14.15.png

In auto-expire, you can just do:

Screenshot%202014-06-28%2011.16.32.png
 
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? :)
 
Back
Top