more queue stuff

This commit is contained in:
hummypkg 2016-12-19 10:14:50 +00:00
parent 4aec6d3679
commit 80e279d536
3 changed files with 39 additions and 18 deletions

View File

@ -1,9 +1,9 @@
Package: sweeper
Priority: optional
Section: misc
Version: 2.1.4
Version: 2.1.4-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.3.4)
Depends: webif(>=1.3.4-3)
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/

View File

@ -461,6 +461,14 @@ proc ::sweeper::flag {ts flag folder} {
return [$ts flag $flag]
}
proc ::sweeper::queue {ts q folder} {
set queues [split [{queue status} $ts] ,]
if {$q eq "any" && [llength $queues]} {
return 1
}
return $($q in $queues)
}
proc ::sweeper::lcn {ts num folder} {
return [::sweeper::intcomp [$ts get channel_num] $num]
}
@ -893,7 +901,7 @@ proc ::sweeper::action_unflag {ts cmd arg folder} {
proc ::sweeper::action_queue {ts cmd arg folder} {
log "Queued [$ts get file] for $arg" 0
if {!$::sweeper::dryrun} {
queue insert $ts $arg
{queue insert} $ts $arg
}
return 0
}
@ -902,9 +910,9 @@ 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
{queue delete} $ts
} else {
queue delete $ts $arg
{queue delete} $ts $arg
}
}
return 0

View File

@ -1,4 +1,12 @@
var queueselect = {
decrypt: 'Decryption',
shrink: 'Shrink',
mp3: 'Audio Extraction',
mpg: 'Conversion to MPG'
};
var schema = {
criterion: {
lcn: {
@ -135,6 +143,15 @@ var schema = {
},
def: 'New'
},
queue: {
'class': 'all',
type: 'select',
desc: 'Recording Queued for',
idesc: 'Recording not Queued for',
negate: true,
select: $.extend({any: '-- Anything --'}, queueselect),
def: 'any'
},
lock: {
'class': 'all',
type: 'select',
@ -358,25 +375,14 @@ var schema = {
'class': 'all',
argtype: 'select',
desc: 'Queue recording for',
select: {
decrypt: 'Decryption',
shrink: 'Shrink',
mp3: 'Audio Extraction',
mpg: 'Conversion to MPG'
},
select: queueselect,
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'
},
select: $.extend({any: '-- Everything --'}, queueselect),
continues: true
},
'delete': {
@ -400,3 +406,10 @@ var schema = {
}
};
function register_queue(tag, descr)
{
schema.action.queue.select['detectads'] = 'Ad-detection';
schema.action.dequeue.select['detectads'] = 'Ad-detection';
schema.criterion.queue.select['detectads'] = 'Ad-detection';
}