fix & encoding bug + others

This commit is contained in:
hummypkg 2014-06-06 23:25:10 +00:00
parent f44e2f20fc
commit 72076be0bc
6 changed files with 32 additions and 17 deletions

View File

@ -1,9 +1,9 @@
Package: sweeper
Priority: optional
Section: misc
Version: 1.0.14
Version: 1.0.15
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.0.14-3)
Depends: webif(>=1.0.14-4)
Description: Automatically manage single recording files. [Web Interface. Multi-folder support.]
Tags: http://hummy.tv/forum/threads/3843/

View File

@ -1,4 +1,12 @@
# Example to move all one-off recordings into a directory called 'misc'
# and create it if it doesn't already exist. Remove the # from the start
# of the next line to enable it.
#action {movecreate "misc"}
# Move any Children's films (by length)
## lcn {>= 70} lcn {<= 79} duration {>= 90} action {move Children/Films}
# Move any Children's films (by genre)
## lcn {>= 70} lcn {<= 79} genre Film action {move Children/Films}
# Move anything else recorded from a children's channel
## lcn {>= 70} lcn {<= 79} action {move Children/Miscellaneous}
# Move any series recordings from a Children's channel (folder rule)
## folder lcn {>= 70} lcn {<= 79} action {fileundercreate Children}
# Move any one-off Formula 1 recordings into the F1 folder
## title {Formula 1} action {move F1}
# Move any one-off recordings into a folder called Misc after a while
## age {> 120} action {movecreate Misc}

View File

@ -3,5 +3,6 @@
for f in webif/plugin/sweeper/; do
rsync -avr --delete --exclude=.svn humax:/mod/$f ./$f
done
[ -f webif/plugin/sweeper/.raw ] && rm -f webif/plugin/sweeper/.raw

View File

@ -34,7 +34,11 @@ if {$dir eq "" || $dir eq $root} {
}
}
set data [cgi_get data "-"]
set data [string map {
&amp; &
&lt; <
&gt; >
} [cgi_get data "-"]]
if {$data eq "-" || $data eq ""} {
if {[file exists $cf]} { file delete $cf }

View File

@ -68,7 +68,7 @@ var schema = {
Unclassified: 'Unclassified',
Film: 'Film',
Children: 'Children',
'News & Factual': 'News & Factual',
'News &amp; Factual': 'News &amp; Factual',
Entertainment: 'Entertainment',
Sport: 'Sport',
Education: 'Education',

View File

@ -86,7 +86,7 @@ var getters = {
for (key in c)
if (c[key] == a)
return key;
return 'UNKNOWN (' + a + ')';
return 'UNKNOWNKEY (' + a + ')';
}
};
@ -102,7 +102,7 @@ function ruleconf(rule)
rule.find('tr.clause').each(function(i) {
cmd = $(this).find('th.cmd').attr('cmd');
c = schema.criterion[cmd];
val = $.trim($(this).find('td.val').text());
val = $.trim($(this).find('td.val').html());
if (getters[c.type])
val = getters[c.type](cmd, val);
@ -331,7 +331,7 @@ function edit_select(obj, title, options, val, callback)
$('#edit_select_field').empty();
$.each(options, function(k, v) {
$('#edit_select_field').append(
$('<option></option>').attr('value', k).text(v)
$('<option></option>').attr('value', k).html(v)
);
});
if (val && val != '')
@ -362,7 +362,8 @@ function edit_clause(obj)
{
var cmd = $(obj).find('th.cmd').attr('cmd');
var target = $(obj).find('td.val');
var val = $.trim($(target).text());
var tval = $.trim($(target).text());
var val = $.trim($(target).html());
var title = $(obj).find('th.cmd').html();
if (!schema.criterion[cmd])
{
@ -371,22 +372,23 @@ function edit_clause(obj)
}
switch (schema.criterion[cmd].type)
{
case 'string':
case 'substr':
edit_text(target, title, val, function(obj, text) {
$(obj).text(text);
edit_text(target, title, tval, function(obj, text) {
$(obj).html(text);
rulerefresh($(obj).closest('div.rule'));
changed(1);
});
break;
case 'int':
b = val.split(" ");
b = tval.split(" ");
if (b.length != 2)
{
alert('Bad int value');
break;
}
edit_int(target, title, b[0], b[1], function(obj, op, val) {
$(obj).text(op + ' ' + val);
$(obj).html(op + ' ' + val);
rulerefresh($(obj).closest('div.rule'));
changed(1);
});
@ -394,7 +396,7 @@ function edit_clause(obj)
case 'select':
edit_select(target, title, schema.criterion[cmd].select,
getters.select(cmd, val), function(obj, val) {
$(obj).text(setters.select(cmd, val));
$(obj).html(setters.select(cmd, val));
rulerefresh($(obj).closest('div.rule'));
changed(1);
});