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 Package: sweeper
Priority: optional Priority: optional
Section: misc Section: misc
Version: 2.1.5-10 Version: 2.2.0
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.4.2-10) 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/ Tags: http://hummy.tv/forum/threads/5138/

View File

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

View File

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