Old sweeper package to file away one-off recordings

Status
Not open for further replies.
Sweeper doesn't like programme names with accents in them. perhaps this isn't that common but a show named like this "Seitsemän Uutiset_20131030_1900.ts" will crash sweeper and it doesn't process anything else. The auto script says "aborted" if I configure sweeper.conf to recognize a name (any name, not one containing the accented characters). Probably the quoting of the filename variable is wrong in the code.
The output from ls doesn't show the name properly either, but shell completion does. I think sweeper might be mixing up the two (notice the ?? in ls output below, but bash completion shows the actual filename)

humax# ls
Finnish News Seitsem??n Uutiset_20131030_1900.nts
Grand Designs Seitsem??n Uutiset_20131030_1900.ts
Other shows Travel
Seitsem??n Uutiset_20131030_1900.hmt

humax# ls -l Seitsemän\ Uutiset_20131030_1900.ts
-rw-r--r-- 1 root root 492130304 Oct 30 17:19 Seitsem??n Uutiset_20131030_1900.ts

Looking at the code the problem is that tolower is used in the function strcontains and this crashes the programme when accented characters are in the filename. I removed the tolower parts and now it works ok (but is case specific)

proc ::sweeper::strcontains {ref val} {
return [expr \
[string first [string tolower$val] [string tolower $ref]] \
>= 0]
}
 
There isn't a lot in the EPG for the next week with non-standard characters in it but I've set a few things to record to give me some test files:

HÈaxan: Witchcraft Through the Ages
BaarÁia
The House That £100k Built
 
thanks for the quick reply. I did some more checking and updated my original post. the problem is tolower used in function "strcontains". that function crashes the program with the accented characters. Is the language TCL ? I don't know it well enough to suggest what to do. Strip out all characters not in a..z and 1..9?
For me i'm happy with it being case specific and then it works (once I change the strcontains function)
 
Yes, it's a variant of TCL. Odd that it's crashing; it should be possible to work out why and submit a patch to the author.
 
it is related to utf-8 character set. That's why the single letter A with dots over it in "SeitsemÄn" appears as two characters in the filename or two question marks in ls output (one letter ends up as two bytes). tolower then crashes if a utf-8 character is in the string to convert.
 
Jim is supposed to support UTF-8 so it's a bug somewhere. I should have some test recordings in a day or two.
 
I think you can just rename an existing file and then run sweeper to see what it will do. i'm not sure how you rename the file with a utf-8 character in it though.
One thing I have thought of is another sh script to rename the files and strip utf-8 characters from the filenames before sweeper can see them.
This works for one file (called 'file') and could be extended to do several files or be called via find (although it should exclude files currently in use)

Code:
mv 'file' $(echo 'file' | sed -e 's/[^A-Za-z0-9._-]/_/g')
 
Is the following command correct? I'm trying to filter anything recorded on channel 46 into a folder

Code:
 lcn {=46} action {movecreate "Gameshows"}
 
Just


Code:
 lcn 46 action {movecreate "Gameshows"}

will do it. What you have is almost right too - just needs a space between the = and the 46 if you want to use that syntax.



I've just tested this out, but as I have the move any single recordings into the misc folder, this seems to override the lcn 46 command. Is there any way to alter this?

Thanks
 
The commands are processed in order, and aborted when one matches. Put the lcn 46 command further up the list that the "if nothing else, do this" command (which should of course come last).
 
Has anyone got the lock process to work with sweeper or am I doing something wrong ?

In the sweeper.conf file I have

Code:
hour {>= 21} action lock 1 {movecreate _OTHER/%genre}

but after trying this sweeper just ignores this line and moves to the next line and in auto.log the following error appears

Code:
31/10/2013 23:51 - Unknown action 'lock'
 
According to post 1 in this topic, "lock" isn't an action so should come before the word "action" (with no parameter).
 
According to post 1 in this topic, "lock" isn't an action so should come before the word "action" (with no parameter).

Thank you . I have changed it to

Code:
hour {>= 21} lock 1 action  {movecreate _OTHER/%genre}
hour {<7} lock 1 action {movecreate _OTHER/%genre}

and it works, locking any once off recordings recorded at night and moving them to specified folders.
 
I don't understand where the "lock 1" comes from. Shouldn't it be just "lock" and the "1" is superfluous? That's what I was hinting at in my last post (apparently unsuccessfully).
 
I don't understand where the "lock 1" comes from. Shouldn't it be just "lock" and the "1" is superfluous? That's what I was hinting at in my last post (apparently unsuccessfully).

I was trying to follow examples from the Wiki. 'lock 1' is on the wiki - could it refer to previous versions of sweeper ?
 
lock requires an argument (all conditions in sweeper require an argument) and that is either 1 to lock or 0 to unlock.

lock is actually a condition that is always true and has a side affect.. not particularly pretty but does the job.
 
Status
Not open for further replies.
Back
Top