tweak icon, add delete

This commit is contained in:
hummypkg 2014-06-10 22:02:48 +00:00
parent 1eaff8d5d2
commit a67715928a
6 changed files with 46 additions and 7 deletions

View File

@ -1,9 +1,9 @@
Package: sweeper
Priority: optional
Section: misc
Version: 1.0.17
Version: 1.0.18
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.0.14-6)
Description: Automatically manage single recording files. [Web Interface. Multi-folder support.]
Tags: http://hummy.tv/forum/threads/3843/
Depends: webif(>=1.0.14-8)
Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [See forum thread]
Tags: http://hummy.tv/forum/threads/5138/

View File

@ -224,6 +224,13 @@ proc ::sweeper::action {ts cmds} {
}
return 0
}
delete {
log "Deleting [$ts get file]" 0
if {!$::sweeper::dryrun} {
safe_delete [$ts get file] sweeper
}
return 1
}
default {
log "Unknown action '$cmd'" 0
}
@ -409,6 +416,15 @@ proc ::sweeper::folder_action {ts cmds} {
}]
return 0
}
delete {
::sweeper::folder_apply $folder [lambda {ts} {
log "Deleting [$ts get file]" 0
if {!$::sweeper::dryrun} {
safe_delete [$ts get file] sweeper
}
}]
return 1
}
default {
log "Unknown action '$cmd'" 0
}

View File

@ -12,6 +12,11 @@ jscss {schema.js config.jim script.js} style.css
jqplugin confirmAction enadis
header
if {![file isdirectory $dir]} {
puts "<h3>No such directory, $dir</h3>"
exit
}
puts "
<h3>
<img src=img/icon22.png> Sweeper rules for
@ -154,8 +159,7 @@ Add pre-defined ruleset:
</div>
<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 />
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -185,7 +185,13 @@ var schema = {
'class': 'all',
argtype: 'string',
desc: 'Rename recording files to...',
continue: true
continues: true
},
delete: {
'class': 'all',
argtype: 'none',
desc: 'Delete recordings',
continues: false
}
}
};

View File

@ -752,7 +752,12 @@ $('#ruleset')
var arg = rule.find('tr.action td.val').html();
if (schema.action[cmd].argtype == 'none')
{
arg = '';
$('#edit_action_arg').disable();
}
else
$('#edit_action_arg').enable();
if (schema.action[cmd].argtype == 'folder' && arg == mroot)
arg = '';
@ -821,6 +826,14 @@ $('#ruleset')
});
});
$('#edit_action_act').on('change', function(e) {
var cmd = $(this).val();
if (schema.action[cmd].argtype == 'none')
$('#edit_action_arg').disable();
else
$('#edit_action_arg').enable();
})
// Set up macros
$.each(macros, function(key, val) {
$('#macroselect').append(