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 Package: sweeper
Priority: optional Priority: optional
Section: misc Section: misc
Version: 2.1.4 Version: 2.1.4-1
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk 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] 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/ Tags: http://hummy.tv/forum/threads/5138/

View File

@ -461,6 +461,14 @@ proc ::sweeper::flag {ts flag folder} {
return [$ts flag $flag] 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} { proc ::sweeper::lcn {ts num folder} {
return [::sweeper::intcomp [$ts get channel_num] $num] 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} { proc ::sweeper::action_queue {ts cmd arg folder} {
log "Queued [$ts get file] for $arg" 0 log "Queued [$ts get file] for $arg" 0
if {!$::sweeper::dryrun} { if {!$::sweeper::dryrun} {
queue insert $ts $arg {queue insert} $ts $arg
} }
return 0 return 0
} }
@ -902,9 +910,9 @@ proc ::sweeper::action_dequeue {ts cmd arg folder} {
log "De-queued [$ts get file] for $arg" 0 log "De-queued [$ts get file] for $arg" 0
if {!$::sweeper::dryrun} { if {!$::sweeper::dryrun} {
if {$arg eq "all"} { if {$arg eq "all"} {
queue delete $ts {queue delete} $ts
} else { } else {
queue delete $ts $arg {queue delete} $ts $arg
} }
} }
return 0 return 0

View File

@ -1,4 +1,12 @@
var queueselect = {
decrypt: 'Decryption',
shrink: 'Shrink',
mp3: 'Audio Extraction',
mpg: 'Conversion to MPG'
};
var schema = { var schema = {
criterion: { criterion: {
lcn: { lcn: {
@ -135,6 +143,15 @@ var schema = {
}, },
def: 'New' 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: { lock: {
'class': 'all', 'class': 'all',
type: 'select', type: 'select',
@ -358,25 +375,14 @@ var schema = {
'class': 'all', 'class': 'all',
argtype: 'select', argtype: 'select',
desc: 'Queue recording for', desc: 'Queue recording for',
select: { select: queueselect,
decrypt: 'Decryption',
shrink: 'Shrink',
mp3: 'Audio Extraction',
mpg: 'Conversion to MPG'
},
continues: true continues: true
}, },
dequeue: { dequeue: {
'class': 'all', 'class': 'all',
argtype: 'select', argtype: 'select',
desc: 'De-queue recording for', desc: 'De-queue recording for',
select: { select: $.extend({any: '-- Everything --'}, queueselect),
all: '-- Everything --',
decrypt: 'Decryption',
shrink: 'Shrink',
mp3: 'Audio Extraction',
mpg: 'Conversion to MPG'
},
continues: true continues: true
}, },
'delete': { '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';
}