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 Package: sweeper
Priority: optional Priority: optional
Section: misc Section: misc
Version: 1.0.14 Version: 1.0.15
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk 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.] Description: Automatically manage single recording files. [Web Interface. Multi-folder support.]
Tags: http://hummy.tv/forum/threads/3843/ 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' # Move any Children's films (by length)
# and create it if it doesn't already exist. Remove the # from the start ## lcn {>= 70} lcn {<= 79} duration {>= 90} action {move Children/Films}
# of the next line to enable it. # Move any Children's films (by genre)
#action {movecreate "misc"} ## 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 for f in webif/plugin/sweeper/; do
rsync -avr --delete --exclude=.svn humax:/mod/$f ./$f rsync -avr --delete --exclude=.svn humax:/mod/$f ./$f
done 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 {$data eq "-" || $data eq ""} {
if {[file exists $cf]} { file delete $cf } if {[file exists $cf]} { file delete $cf }

View File

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

View File

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