diff --git a/CONTROL/control b/CONTROL/control
index 283086a..98ddc50 100644
--- a/CONTROL/control
+++ b/CONTROL/control
@@ -1,9 +1,9 @@
Package: sweeper
Priority: optional
Section: misc
-Version: 2.1.5
+Version: 2.1.5-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
-Depends: webif(>=1.3.5)
+Depends: webif(>=1.3.5-2)
Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [See forum for details]
Tags: http://hummy.tv/forum/threads/5138/
diff --git a/webif/plugin/sweeper/auto.hook b/webif/plugin/sweeper/auto.hook
index e8359ec..8d6a5ac 100644
--- a/webif/plugin/sweeper/auto.hook
+++ b/webif/plugin/sweeper/auto.hook
@@ -900,8 +900,13 @@ proc ::sweeper::action_unflag {ts cmd arg folder} {
proc ::sweeper::action_queue {ts cmd arg folder} {
log "Queued [$ts get file] for $arg" 0
+ set opt [lassign $arg arg]
+ log "ARG: ($arg) OPT: ($opt)" 2
if {!$::sweeper::dryrun} {
- {queue insert} $ts $arg
+ set q [{queue insert} $ts $arg]
+ if {[string trim $opt] ne ""} {
+ $q set args $opt
+ }
}
return 0
}
diff --git a/webif/plugin/sweeper/edit.jim b/webif/plugin/sweeper/edit.jim
index 9250762..c1fbf04 100755
--- a/webif/plugin/sweeper/edit.jim
+++ b/webif/plugin/sweeper/edit.jim
@@ -234,9 +234,13 @@ For pattern matching, the following special sequences may appear in the pattern:
-
+
+
Enter one of:
diff --git a/webif/plugin/sweeper/schema.js b/webif/plugin/sweeper/schema.js
index a9e7442..bbd31da 100644
--- a/webif/plugin/sweeper/schema.js
+++ b/webif/plugin/sweeper/schema.js
@@ -373,7 +373,7 @@ var schema = {
},
queue: {
'class': 'all',
- argtype: 'select',
+ argtype: 'selectx',
desc: 'Queue recording for',
select: queueselect,
continues: true
diff --git a/webif/plugin/sweeper/script.js b/webif/plugin/sweeper/script.js
index 318285d..5dc39ab 100644
--- a/webif/plugin/sweeper/script.js
+++ b/webif/plugin/sweeper/script.js
@@ -13,6 +13,21 @@ function quot(str)
return '{' + str + '}';
}
+function splitarg(arg)
+{
+ o = {
+ 'arg': arg,
+ 'opt': ''
+ };
+ i = arg.indexOf(' ');
+ if (i > -1)
+ {
+ o.arg = arg.substring(0, i);
+ o.opt = arg.substring(i + 1);
+ }
+ return o;
+}
+
function fixupdown()
{
$('#ruleset a.uprule').enable().filter(':first').disable();
@@ -170,6 +185,15 @@ function ruleconf(rule)
rule.find('tr.action td.val').attr('val'));
s += 'action {' + act + ' ' + quot(arg) + '}';
break;
+ case 'selectx':
+ arg = $.trim(
+ rule.find('tr.action td.val').attr('val'));
+ opt = $.trim(
+ rule.find('tr.action td.val').attr('opt'));
+ if (opt)
+ arg += ' ' + opt;
+ s += 'action {' + act + ' ' + quot(arg) + '}';
+ break;
default:
s += 'action {' + act + ' ' + quot(arg) + '}';
break;
@@ -315,11 +339,26 @@ function action(data)
s = '' +
'Then: | ' +
'' + c.desc + ' | ';
- if (c.argtype == 'select')
+
+ switch (c.argtype)
+ {
+ case 'select':
s += '' +
c.select[data.arg];
- else
+ break;
+ case 'selectx':
+ a = splitarg(data.arg);
+ s += ' | ' +
+ c.select[a.arg];
+ if (a.opt)
+ s += ' (' + a.opt + ')';
+ break;
+ default:
s += ' | ' + data.arg;
+ break;
+ }
+
s += ' | ' +
'' +
' | ' +
@@ -1148,16 +1187,24 @@ $('#ruleset')
arg = '';
$('#edit_action_act').val(cmd).trigger('change');
- if (schema.action[cmd].argtype == 'select')
+ switch (schema.action[cmd].argtype)
{
+ case 'selectx':
+ opt = rule.find('tr.action td.val').attr('opt');
+ $('#edit_action_select_arg').val(opt);
+ // Pass-through...
+ case 'select':
+ arg = rule.find('tr.action td.val').attr('val');
$('#edit_action_select_field').val(arg);
$.each(schema.action[cmd].select, function(k, v) {
if (arg == v)
$('#edit_action_select_field').val(k);
});
- }
- else
+ break;
+ default:
$('#edit_action_arg').val(arg);
+ break;
+ }
$('#edit_action').dialog({
height: 'auto', width: 'auto',
@@ -1172,11 +1219,25 @@ $('#ruleset')
buttons: {
"Save": function() {
cmd = $('#edit_action_act').val();
- if (schema.action[cmd].argtype == 'select')
+ switch (schema.action[cmd].argtype)
+ {
+ case 'select':
arg = $('#edit_action_select_field')
.val();
- else
+ break;
+ case 'selectx':
+ arg = $('#edit_action_select_field')
+ .val();
+ opt = $.trim(
+ $('#edit_action_select_arg').val()
+ );
+ if (opt)
+ arg += ' ' + opt;
+ break;
+ default:
arg = $('#edit_action_arg').val();
+ break;
+ }
rule.find('table.action tbody').empty()
.append(action({cmd: cmd, arg: arg}));
@@ -1256,11 +1317,15 @@ $('#ruleset')
$('#edit_action_arg').show();
$('#edit_action_select_field').hide();
+ $('#edit_action_select_arg').hide();
switch (schema.action[cmd].argtype)
{
case 'none':
- $('#edit_action_arg').disable();
+ $('#edit_action_arg').hide().disable();
break;
+ case 'selectx':
+ $('#edit_action_select_arg').empty().show();
+ // Fall-through...
case 'select':
$('#edit_action_arg').hide();
$('#edit_action_select_field').empty().show();