add now condition

This commit is contained in:
hummypkg 2014-07-03 18:46:52 +00:00
parent 92a11f1092
commit 2ec708a887
4 changed files with 16 additions and 2 deletions

View File

@ -1,7 +1,7 @@
Package: sweeper
Priority: optional
Section: misc
Version: 2.0.6
Version: 2.0.7
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.0.15-5)

View File

@ -11,7 +11,9 @@ fi
[ -f /mod/.swschema ] && schema=`cat /mod/.swschema` || schema=1
case schema in
echo "Current Sweeper schema: $schema"
case $schema in
1)
# Upgrade folder rules
echo "Upgrading sweeper rules for folder series."

View File

@ -289,6 +289,11 @@ proc ::sweeper::hour {ts str folder} {
return [::sweeper::intcomp $hour $str]
}
proc ::sweeper::now {ts str folder} {
set now [clock format [clock seconds] -format "%H%M"]
return [::sweeper::intcomp $now $str]
}
proc ::sweeper::schedduration {ts dur folder} {
return [::sweeper::intcomp [expr [$ts get scheddur] / 60] $dur]
}

View File

@ -49,6 +49,13 @@ var schema = {
negate: true,
def: "0"
},
now: {
'class': 'all',
type: 'int',
desc: 'Current time in 24-hour format (HHMM)',
negate: true,
def: "0"
},
title: {
'class': 'all',
type: 'substr',