beta 2.1.4
This commit is contained in:
parent
44bcd90b9f
commit
4aec6d3679
|
@ -1,9 +1,9 @@
|
||||||
Package: sweeper
|
Package: sweeper
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: misc
|
Section: misc
|
||||||
Version: 2.1.3-1
|
Version: 2.1.4
|
||||||
Architecture: mipsel
|
Architecture: mipsel
|
||||||
Maintainer: af123@hummypkg.org.uk
|
Maintainer: af123@hummypkg.org.uk
|
||||||
Depends: webif(>=1.3.0-1)
|
Depends: webif(>=1.3.4)
|
||||||
Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [See forum for details]
|
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/
|
Tags: http://hummy.tv/forum/threads/5138/
|
||||||
|
|
|
@ -890,6 +890,26 @@ proc ::sweeper::action_unflag {ts cmd arg folder} {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc ::sweeper::action_queue {ts cmd arg folder} {
|
||||||
|
log "Queued [$ts get file] for $arg" 0
|
||||||
|
if {!$::sweeper::dryrun} {
|
||||||
|
queue insert $ts $arg
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
proc ::sweeper::action_dequeue {ts cmd arg folder} {
|
||||||
|
log "De-queued [$ts get file] for $arg" 0
|
||||||
|
if {!$::sweeper::dryrun} {
|
||||||
|
if {$arg eq "all"} {
|
||||||
|
queue delete $ts
|
||||||
|
} else {
|
||||||
|
queue delete $ts $arg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
eval_plugins sweeper
|
eval_plugins sweeper
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -235,6 +235,8 @@ For pattern matching, the following special sequences may appear in the pattern:
|
||||||
<div class=hidden id=edit_action title="Rule Action">
|
<div class=hidden id=edit_action title="Rule Action">
|
||||||
<select name=edit_action_act id=edit_action_act></select>
|
<select name=edit_action_act id=edit_action_act></select>
|
||||||
<input name=edit_action_arg id=edit_action_arg size=60 maxlength=255 />
|
<input name=edit_action_arg id=edit_action_arg size=60 maxlength=255 />
|
||||||
|
<select class=hidden name=edit_action_select_field
|
||||||
|
id=edit_action_select_field></select>
|
||||||
<div class="hidden edit_action_help blood" id=edit_action_help_folder>
|
<div class="hidden edit_action_help blood" id=edit_action_help_folder>
|
||||||
Enter one of:
|
Enter one of:
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
source /mod/webif/lib/setup
|
source /mod/webif/lib/setup
|
||||||
require lock system.class ts.class pretty_size browse.class \
|
require lock system.class ts.class pretty_size browse.class \
|
||||||
safe_delete settings.class plugin
|
safe_delete settings.class plugin queue.class
|
||||||
|
|
||||||
proc log {msg {level 1}} {
|
proc log {msg {level 1}} {
|
||||||
puts "[\
|
puts "[\
|
||||||
|
|
|
@ -324,14 +324,59 @@ var schema = {
|
||||||
},
|
},
|
||||||
flag: {
|
flag: {
|
||||||
'class': 'all',
|
'class': 'all',
|
||||||
argtype: 'string',
|
argtype: 'select',
|
||||||
desc: 'Set recording flag...',
|
desc: 'Set recording flag...',
|
||||||
|
select: {
|
||||||
|
Locked: 'Locked',
|
||||||
|
New: 'New',
|
||||||
|
Encrypted: 'Encrypted',
|
||||||
|
Guidance: 'Guidance',
|
||||||
|
ODEncrypted: 'Encrypted On-Disk',
|
||||||
|
Shrunk: 'Shrunk',
|
||||||
|
Deduped: 'De-duplicated',
|
||||||
|
Radio: 'Radio Programme'
|
||||||
|
},
|
||||||
continues: true
|
continues: true
|
||||||
},
|
},
|
||||||
unflag: {
|
unflag: {
|
||||||
'class': 'all',
|
'class': 'all',
|
||||||
argtype: 'string',
|
argtype: 'select',
|
||||||
desc: 'Unset recording flag...',
|
desc: 'Unset recording flag...',
|
||||||
|
select: {
|
||||||
|
Locked: 'Locked',
|
||||||
|
New: 'New',
|
||||||
|
Encrypted: 'Encrypted',
|
||||||
|
Guidance: 'Guidance',
|
||||||
|
ODEncrypted: 'Encrypted On-Disk',
|
||||||
|
Shrunk: 'Shrunk',
|
||||||
|
Deduped: 'De-duplicated',
|
||||||
|
Radio: 'Radio Programme'
|
||||||
|
},
|
||||||
|
continues: true
|
||||||
|
},
|
||||||
|
queue: {
|
||||||
|
'class': 'all',
|
||||||
|
argtype: 'select',
|
||||||
|
desc: 'Queue recording for',
|
||||||
|
select: {
|
||||||
|
decrypt: 'Decryption',
|
||||||
|
shrink: 'Shrink',
|
||||||
|
mp3: 'Audio Extraction',
|
||||||
|
mpg: 'Conversion to MPG'
|
||||||
|
},
|
||||||
|
continues: true
|
||||||
|
},
|
||||||
|
dequeue: {
|
||||||
|
'class': 'all',
|
||||||
|
argtype: 'select',
|
||||||
|
desc: 'De-queue recording for',
|
||||||
|
select: {
|
||||||
|
all: '-- Everything --',
|
||||||
|
decrypt: 'Decryption',
|
||||||
|
shrink: 'Shrink',
|
||||||
|
mp3: 'Audio Extraction',
|
||||||
|
mpg: 'Conversion to MPG'
|
||||||
|
},
|
||||||
continues: true
|
continues: true
|
||||||
},
|
},
|
||||||
'delete': {
|
'delete': {
|
||||||
|
|
|
@ -160,10 +160,20 @@ function ruleconf(rule)
|
||||||
arg = '';
|
arg = '';
|
||||||
if (act != 'continue')
|
if (act != 'continue')
|
||||||
{
|
{
|
||||||
if (schema.action[act].argtype == 'none')
|
switch (schema.action[act].argtype)
|
||||||
|
{
|
||||||
|
case 'none':
|
||||||
s += 'action ' + act;
|
s += 'action ' + act;
|
||||||
else
|
break;
|
||||||
|
case 'select':
|
||||||
|
arg = $.trim(
|
||||||
|
rule.find('tr.action td.val').attr('val'));
|
||||||
s += 'action {' + act + ' ' + quot(arg) + '}';
|
s += 'action {' + act + ' ' + quot(arg) + '}';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
s += 'action {' + act + ' ' + quot(arg) + '}';
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -304,8 +314,13 @@ function action(data)
|
||||||
|
|
||||||
s = '<tr class=action>' +
|
s = '<tr class=action>' +
|
||||||
'<th class=title>Then:</th>' +
|
'<th class=title>Then:</th>' +
|
||||||
'<th class=cmd cmd=' + data.cmd + '>' + c.desc + '</th>' +
|
'<th class=cmd cmd=' + data.cmd + '>' + c.desc + '</th>';
|
||||||
'<td class=val>' + data.arg + '</td>' +
|
if (c.argtype == 'select')
|
||||||
|
s += '<td class=val val=\"' + data.arg + '\">' +
|
||||||
|
c.select[data.arg];
|
||||||
|
else
|
||||||
|
s += '<td class=val>' + data.arg;
|
||||||
|
s += '</td>' +
|
||||||
'<td><a class=editaction href=#>' +
|
'<td><a class=editaction href=#>' +
|
||||||
'<img src=img/edit.png></a></td>' +
|
'<img src=img/edit.png></a></td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
|
@ -1127,23 +1142,22 @@ $('#ruleset')
|
||||||
|
|
||||||
var cmd = rule.find('tr.action th.cmd').attr('cmd');
|
var cmd = rule.find('tr.action th.cmd').attr('cmd');
|
||||||
var arg = rule.find('tr.action td.val').html();
|
var arg = rule.find('tr.action td.val').html();
|
||||||
|
|
||||||
if (schema.action[cmd].argtype == 'none')
|
if (schema.action[cmd].argtype == 'none')
|
||||||
{
|
|
||||||
arg = '';
|
arg = '';
|
||||||
$('#edit_action_arg').disable();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$('#edit_action_arg').enable();
|
|
||||||
|
|
||||||
$('.edit_action_help').hide();
|
|
||||||
$('#edit_action_help_' + schema.action[cmd].argtype).show();
|
|
||||||
|
|
||||||
if (schema.action[cmd].argtype == 'folder' && arg == mroot)
|
if (schema.action[cmd].argtype == 'folder' && arg == mroot)
|
||||||
arg = '';
|
arg = '';
|
||||||
|
|
||||||
$('#edit_action_act').val(cmd);
|
$('#edit_action_act').val(cmd).trigger('change');
|
||||||
$('#edit_action_arg').val(arg);
|
if (schema.action[cmd].argtype == 'select')
|
||||||
|
{
|
||||||
|
$('#edit_action_select_field').val(arg);
|
||||||
|
$.each(schema.action[cmd].select, function(k, v) {
|
||||||
|
if (arg == v)
|
||||||
|
$('#edit_action_select_field').val(k);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$('#edit_action_arg').val(arg);
|
||||||
|
|
||||||
$('#edit_action').dialog({
|
$('#edit_action').dialog({
|
||||||
height: 'auto', width: 'auto',
|
height: 'auto', width: 'auto',
|
||||||
|
@ -1158,7 +1172,11 @@ $('#ruleset')
|
||||||
buttons: {
|
buttons: {
|
||||||
"Save": function() {
|
"Save": function() {
|
||||||
cmd = $('#edit_action_act').val();
|
cmd = $('#edit_action_act').val();
|
||||||
arg = $('#edit_action_arg').val();
|
if (schema.action[cmd].argtype == 'select')
|
||||||
|
arg = $('#edit_action_select_field')
|
||||||
|
.val();
|
||||||
|
else
|
||||||
|
arg = $('#edit_action_arg').val();
|
||||||
|
|
||||||
rule.find('table.action tbody').empty()
|
rule.find('table.action tbody').empty()
|
||||||
.append(action({cmd: cmd, arg: arg}));
|
.append(action({cmd: cmd, arg: arg}));
|
||||||
|
@ -1235,6 +1253,31 @@ $('#ruleset')
|
||||||
|
|
||||||
$('#edit_action_act').on('change', function(e) {
|
$('#edit_action_act').on('change', function(e) {
|
||||||
var cmd = $(this).val();
|
var cmd = $(this).val();
|
||||||
|
|
||||||
|
$('#edit_action_arg').show();
|
||||||
|
$('#edit_action_select_field').hide();
|
||||||
|
switch (schema.action[cmd].argtype)
|
||||||
|
{
|
||||||
|
case 'none':
|
||||||
|
$('#edit_action_arg').disable();
|
||||||
|
break;
|
||||||
|
case 'select':
|
||||||
|
$('#edit_action_arg').hide();
|
||||||
|
$('#edit_action_select_field').empty().show();
|
||||||
|
$.each(schema.action[cmd].select, function(k, v) {
|
||||||
|
$('#edit_action_select_field').append(
|
||||||
|
$('<option></option>')
|
||||||
|
.attr('value', k).text(v)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('#edit_action_arg').enable();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.edit_action_help').hide();
|
||||||
|
$('#edit_action_help_' + schema.action[cmd].argtype).show();
|
||||||
if (schema.action[cmd].argtype == 'none')
|
if (schema.action[cmd].argtype == 'none')
|
||||||
$('#edit_action_arg').disable();
|
$('#edit_action_arg').disable();
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue