Improve recursion settings

This commit is contained in:
hummypkg 2019-10-27 11:33:03 +00:00
parent e92df126f1
commit f3606e1445
3 changed files with 26 additions and 8 deletions

View File

@ -1,9 +1,9 @@
Package: sweeper
Priority: optional
Section: misc
Version: 2.1.5-10
Version: 2.2.0
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.4.2-10)
Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [Add %bfolder token]
Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [Improve recursion settings]
Tags: http://hummy.tv/forum/threads/5138/

View File

@ -95,6 +95,10 @@ Add pre-defined ruleset:
</a>
</span>
</legend>
<div class="filecomment hidden">
For each recording
<a class=editdepth href=#><img src=img/edit.png></a>:
</div>
<div class="foldercomment hidden">
For each sub-folder, inspect a recording within and:
</div>
@ -152,6 +156,7 @@ For pattern matching, the following special sequences may appear in the pattern:
</div>
<div class=hidden id=edit_plainint title="Edit int">
<span id=edit_plainint_title></span>
<input name=edit_plainint_field id=edit_plainint_field type=number
size=5 maxlength=6 />
</div>
@ -211,7 +216,7 @@ For pattern matching, the following special sequences may appear in the pattern:
<input name=newrule_type id=newrule_type_recurse type=radio
value='recurse' />Process Files and Files within Folders
<br>
Description:
Rule name:
<input name=newrule_comment id=newrule_comment size=80 maxlength=255 />
<div id=newrule_depth_box class=hidden>
Recursion Depth:

View File

@ -419,6 +419,7 @@ function addrule(id, data)
break;
default:
rule.find('.commentleft > span.file').show();
rule.find('.filecomment').show();
break;
}
rule.attr('type', data.type);
@ -523,9 +524,11 @@ function edit_int(obj, title, op, val, callback)
});
}
function edit_plainint(obj, title, val, callback)
function edit_plainint(obj, title, field, val, min, max, callback)
{
$('#edit_plainint_field').val(val);
$('#edit_plainint_field').attr('min', min).attr('max', max);
$('#edit_plainint_title').text(field);
$('#edit_plainint').dialog({
title: title,
height: 'auto', width: 'auto',
@ -541,7 +544,7 @@ function edit_plainint(obj, title, val, callback)
"Save": function() {
var val = $.trim($('#edit_plainint_field')
.val());
if (!val)
if (!val || val < min || val > max)
alert("Bad value");
else
{
@ -1081,13 +1084,23 @@ $('#ruleset')
e.preventDefault();
var rule = $(this).closest('div.rule');
edit_plainint($(this), 'Edit recursion depth',
rule.attr('depth'),
'Set recursion depth: ', rule.attr('depth'), 0, 16,
function(obj, val) {
if (val > 0 && val < 16)
if (val >= 0 && val < 16)
{
rule.attr('depth', val);
if (val > 1)
if (val >= 1)
{
rule.attr('type', 'recurse');
rule.find('.recursecomment').show();
rule.find('.filecomment').hide();
}
else
{
rule.attr('type', 'file');
rule.find('.recursecomment').hide();
rule.find('.filecomment').show();
}
rulerefresh(rule);
changed(1);
}