Remove references to old detctads queue system
This commit is contained in:
parent
c504629a5d
commit
1c58f1ef4c
@ -1,26 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
## Add cron jobs. redundant
|
||||
## nothing to do
|
||||
|
||||
#export tmpf=/tmp/cronf.$$
|
||||
#crontab=$PKG_ROOT/bin/crontab
|
||||
#if [ -x $crontab ]; then
|
||||
# $crontab -l | grep -v /mod/webif/plugin/detectads/detectads > $tmpf
|
||||
# cat $tmpf - << EOM | $crontab -
|
||||
#8 * * * * /mod/webif/plugin/detectads/detectads -pq>/dev/null 2>&1
|
||||
#EOM
|
||||
#fi
|
||||
#[ -f $tmpf ] && rm -f $tmpf
|
||||
|
||||
# Delete old queue db
|
||||
/mod/webif/plugin/detectads/killdb
|
||||
|
||||
# Initdb with extra columns
|
||||
#/mod/webif/plugin/detectads/initdb
|
||||
|
||||
# ReMove data files from previous locations
|
||||
[ -f /mod/boot/detectads.conf ] && mv /mod/boot/detectads.conf /mod/etc/detectads.conf
|
||||
# ensure lineends are correct
|
||||
[ -f /mod/etc/detectads.conf ] && dos2unix /mod/etc/detectads.conf
|
||||
exit 0
|
||||
|
||||
|
@ -1,14 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
export tmpf=/tmp/cronf.$$
|
||||
|
||||
crontab=$PKG_ROOT/bin/crontab
|
||||
if [ -x $crontab ]; then
|
||||
$crontab -l | grep -v /mod/webif/plugin/detectads/detectads > $tmpf
|
||||
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
|
||||
fi
|
||||
|
||||
[ -f $tmpf ] && rm -f $tmpf
|
||||
# nothing to do
|
||||
|
||||
exit 0
|
||||
|
||||
|
@ -24,15 +24,6 @@ proc log {msg {level 1}} {
|
||||
}
|
||||
|
||||
|
||||
set settings [settings]
|
||||
if {[lindex $argv 0] eq "-d"} {
|
||||
set argv [lrange $argv 1 end]
|
||||
set loglevel 2
|
||||
puts "DEBUG ON"
|
||||
} else {
|
||||
set loglevel [$settings _nval_setting "autolog"]
|
||||
}
|
||||
|
||||
if {[$settings _nval_setting "detectads_detwrec"]} {
|
||||
if {$loglevel == 2} {
|
||||
puts "[clock format [clock seconds] -format "%d/%m/%Y %H:%M:%S"] detectads: $argv"
|
||||
@ -46,6 +37,3 @@ if {[$settings _nval_setting "detectads_detwrec"]} {
|
||||
set ts [ts fetch "$file.ts"]
|
||||
::detectads::chancheck $ts
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -7,13 +7,8 @@ proc ::detectads::ts {ts} {
|
||||
return
|
||||
}
|
||||
|
||||
#if {[$ts flag "ODEncrypted"]} {
|
||||
# ::auto::log " $file - not decrypted." 2
|
||||
# return
|
||||
#}
|
||||
|
||||
if {[::auto::inuse $ts]} {
|
||||
::auto::log " $file - In use."
|
||||
::auto::log " $file - In use." 2
|
||||
return
|
||||
}
|
||||
|
||||
@ -47,7 +42,6 @@ proc ::detectads::ts {ts} {
|
||||
}
|
||||
|
||||
proc ::detectads::directory {dir} {
|
||||
#::auto::log "DETECTADS: \[$dir]" 2
|
||||
::auto::direntries $dir ::detectads::ts
|
||||
}
|
||||
|
||||
@ -56,4 +50,3 @@ proc ::detectads::run {} {
|
||||
}
|
||||
|
||||
::auto::register detectads 300
|
||||
|
||||
|
@ -37,17 +37,12 @@ plugins.dmenu_prepare.detectads = function(el, menu) {
|
||||
|
||||
plugins.dmenu_prepare.editdetectads = function(el, menu) {
|
||||
if ($(el).attr('autodetectads') == '1') {
|
||||
|
||||
$(menu).enableContextMenuItems('#editdetectads');
|
||||
//$(menu).showContextMenuItems('#editdetectads');
|
||||
} else {
|
||||
$(menu).disableContextMenuItems('#editdetectads');
|
||||
//$(menu).hideContextMenuItems('#editdetectads');
|
||||
}
|
||||
};
|
||||
|
||||
plugins.dmenu_prepare.nodetectads = function(el, menu) {
|
||||
fixdmenu(el, menu, 'autonodetectads', '#nodetectads', 'No DetectAds', 0);
|
||||
};
|
||||
|
||||
|
||||
|
@ -26,14 +26,7 @@ if {[info exists ::auto::logfile]} {
|
||||
set logfile "/mod/tmp/detectads.log"
|
||||
}
|
||||
|
||||
# Rotate log file if large enough.
|
||||
if {[file exists $logfile] && [file size $logfile] > 2097152} {
|
||||
file copy -force $logfile "/mod/tmp/detectads_old.log"
|
||||
file delete $logfile
|
||||
}
|
||||
|
||||
if {$debug} {
|
||||
#set argv [lrange $argv 1 end]
|
||||
set loglevel 2
|
||||
if {![info exists ::auto::logfd]} {
|
||||
set logfd stdout
|
||||
@ -43,35 +36,17 @@ if {$debug} {
|
||||
# Use same logging option as auto log - mymsman 150515
|
||||
set settings [settings]
|
||||
set loglevel [$settings _nval_setting "autolog"]
|
||||
#set loglevel 1
|
||||
set logfd [open $logfile "a+"]
|
||||
}
|
||||
|
||||
# process command
|
||||
switch -- $opt {
|
||||
|
||||
#-pq { # "Process the old queue"
|
||||
#
|
||||
# if {![acquire_lock detectads]} {
|
||||
# log "-pq Cannot acquire exclusive lock, terminating." 2
|
||||
# exit
|
||||
# }
|
||||
#
|
||||
# #catch {
|
||||
# ::detectads::dequeue_and_process
|
||||
# #}
|
||||
#
|
||||
# release_lock detectads
|
||||
#}
|
||||
-aq { # "Add entry to process queue"
|
||||
#catch {
|
||||
::detectads::queue $ts $time
|
||||
#}
|
||||
}
|
||||
-qq { # "Query if entry on process queue"
|
||||
#catch {
|
||||
set result [::detectads::query_entry_queue_db $ts]
|
||||
#}
|
||||
log "Query [$ts get file] = $result" 2
|
||||
if {$result} {
|
||||
puts "Found $result"
|
||||
@ -81,18 +56,14 @@ switch -- $opt {
|
||||
return $result
|
||||
}
|
||||
-dq { # "Delete entry on process queue"
|
||||
#catch {
|
||||
::detectads::delete_entry_queue_db $ts
|
||||
#}
|
||||
}
|
||||
-pr { # Process single file now
|
||||
#catch {
|
||||
if {[$ts flag "ODEncrypted"]} {
|
||||
::detectads::chaserun $ts
|
||||
} else {
|
||||
::detectads::run $ts
|
||||
}
|
||||
#}
|
||||
}
|
||||
-rs { # Reset ad-detection flag and bookmarks
|
||||
exec hmt "-detectads" "$file"
|
||||
@ -104,8 +75,6 @@ switch -- $opt {
|
||||
puts "detectads = Detect ads in recordings and bookmark or crop them"
|
||||
puts " "
|
||||
puts "detectads -h = produce this help"
|
||||
#puts "detectads -pq = process queued requests (Obsolete)"
|
||||
#puts "detectads -lq = list queued requests"
|
||||
puts "detectads -aq recording ?options? = add recording to request queue"
|
||||
puts "detectads -qq recording = query if recording on request queue"
|
||||
puts "detectads -dq recording = delete recording from request queue"
|
||||
@ -139,19 +108,3 @@ switch -- $opt {
|
||||
}
|
||||
|
||||
}
|
||||
# -lq { # "List the process queue"
|
||||
# #catch {
|
||||
# set result [::detectads::list_queue_db]
|
||||
# #}
|
||||
# if {[llength $result] > 0} {
|
||||
# foreach row $result {
|
||||
# set id $row(id)
|
||||
# set file $row(file)
|
||||
# set start [ clock format $row(start) -format %T ]
|
||||
#
|
||||
# puts "$id : $file $start "
|
||||
# }
|
||||
# } else {
|
||||
# puts "Queue empty"
|
||||
# }
|
||||
# }
|
||||
|
@ -1,104 +1,18 @@
|
||||
package require sqlite3
|
||||
require queue.class
|
||||
|
||||
# virtually obsolete will use syteme queue class instead for new entries
|
||||
proc ::detectads::create_queue_db {} {
|
||||
set retry 0
|
||||
while {$retry<5} {
|
||||
if {[catch {
|
||||
set queue_db [sqlite3.open /mod/etc/detectads_queue.db]
|
||||
$queue_db query {CREATE TABLE IF NOT EXISTS queue(id INTEGER PRIMARY KEY AUTOINCREMENT, file TEXT, start INTEGER DEFAULT 0, retry INTEGER DEFAULT 0)}
|
||||
} msg opts]} {
|
||||
log "caught: $msg $opts" 1
|
||||
incr retry
|
||||
sleep 5
|
||||
} else {break}
|
||||
}
|
||||
|
||||
return $queue_db
|
||||
}
|
||||
|
||||
#proc ::detectads::list_queue_db {} {
|
||||
# return "No longer supported"
|
||||
#
|
||||
# set queue_db [::detectads::create_queue_db]
|
||||
#
|
||||
# set retry 0
|
||||
# while {$retry<5} {
|
||||
# if {[catch {
|
||||
# set result [$queue_db query {SELECT id, file, start FROM queue ORDER BY id ASC }]
|
||||
# } msg opts]} {
|
||||
# log "caught: $msg $opts" 1
|
||||
# incr retry
|
||||
# sleep 5
|
||||
# } else {break}
|
||||
# }
|
||||
#
|
||||
# $queue_db close
|
||||
# return $result
|
||||
#}
|
||||
|
||||
proc ::detectads::query_entry_queue_db {ts} {
|
||||
set result [{queue check} $ts detectads]
|
||||
|
||||
#set queue_db [::detectads::create_queue_db]
|
||||
#
|
||||
#set retry 0
|
||||
#while {$retry<5} {
|
||||
#if {[catch {
|
||||
# set result [$queue_db query {SELECT id FROM queue WHERE file = '%s'} [$ts get file]]
|
||||
# } msg opts]} {
|
||||
# log "caught: $msg $opts" 1
|
||||
# incr retry
|
||||
# sleep 5
|
||||
# } else {break}
|
||||
#}
|
||||
#
|
||||
#$queue_db close
|
||||
return $result
|
||||
}
|
||||
|
||||
proc ::detectads::delete_entry_queue_db {ts} {
|
||||
|
||||
#set queue_db [::detectads::create_queue_db]
|
||||
log "Removing item [$ts get file] from the queue" 1
|
||||
return [{queue delete} $ts detectads]
|
||||
|
||||
#set retry 0
|
||||
#while {$retry<5} {
|
||||
#if {[catch {
|
||||
# $queue_db query {DELETE FROM queue WHERE file = '%s'} [$ts get file]
|
||||
# } msg opts]} {
|
||||
# log "caught: $msg $opts" 1
|
||||
# incr retry
|
||||
# sleep 5
|
||||
# } else {break}
|
||||
#}
|
||||
#
|
||||
#$queue_db close
|
||||
}
|
||||
|
||||
proc ::detectads::delete_entry_queue_db_byId {queue_db qid} {
|
||||
|
||||
set retry 0
|
||||
while {$retry<5} {
|
||||
if {[catch {
|
||||
$queue_db query "DELETE FROM queue WHERE id = $qid"
|
||||
} msg opts]} {
|
||||
log "caught: $msg $opts" 1
|
||||
incr retry
|
||||
sleep 5
|
||||
} else {break}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
proc ::detectads::delete_orphans {} {
|
||||
#set status ""
|
||||
#catch {set status [exec /mod/bin/pgrep -x chaseget ] } msg opts
|
||||
# log "caught: $msg $opts" 1
|
||||
#log "DA Pids $status"
|
||||
#set pidlist [split $status "\n"]
|
||||
if {![catch {exec /mod/bin/pgrep -x chaseget }]} {return}
|
||||
set fl [glob -nocomplain "/mod/tmp/*-inp.ts" "/mod/tmp/*-dec.ts"]
|
||||
log "orphan file list $fl" 2
|
||||
@ -121,7 +35,6 @@ proc ::detectads::checkopts {argv} {
|
||||
set ::opt "-h"
|
||||
set ::debug 0
|
||||
set ::time 0
|
||||
#set ::ts "No file"
|
||||
set parmerror 0
|
||||
|
||||
set settings [settings]
|
||||
@ -204,7 +117,6 @@ proc ::detectads::checkopts {argv} {
|
||||
lappend ::optlist $arg
|
||||
lappend ::optlist $val
|
||||
set ::opts($argx) $nval
|
||||
#puts "found -$argx value $val"
|
||||
continue
|
||||
}
|
||||
}
|
||||
@ -378,7 +290,6 @@ proc ::detectads::queue {ts {time 0} {retrynumb 0}} {
|
||||
catch {
|
||||
set tstart [clock scan $time -format %H:%M]
|
||||
if {$tstart<$start} {incr tstart 86400}
|
||||
#puts "$start [clock format $start -format %D-%T]"
|
||||
set start $tstart
|
||||
}
|
||||
|
||||
@ -394,81 +305,11 @@ proc ::detectads::queue {ts {time 0} {retrynumb 0}} {
|
||||
if {$retrynumb} {$q set retries $retrynumb}
|
||||
set Qid [$q get id]
|
||||
$q submit
|
||||
log "Queued $file Qid $Qid" 1
|
||||
|
||||
#set queue_db [::detectads::create_queue_db]
|
||||
#set retry 0
|
||||
#while {$retry<5} {
|
||||
#if {[catch {
|
||||
# $queue_db query "INSERT INTO queue (file, start, retry) VALUES ('%s', '%s', '%s')" $file $start $retrynumb
|
||||
# set Qid [$queue_db lastid]
|
||||
# } msg opts]} {
|
||||
# log "caught: $msg $opts" 1
|
||||
# incr retry
|
||||
# sleep 5
|
||||
# } else {break}
|
||||
#}
|
||||
#
|
||||
#$queue_db close
|
||||
#
|
||||
#if {$start <= [clock seconds]} {
|
||||
# # Run deque and process asyncronously - mymsman 150418
|
||||
# exec /mod/webif/plugin/detectads/detectads -pq >>/mod/tmp/detectads.log &
|
||||
#
|
||||
# log " DETECTADS: Queued $file for advert detection, Qid $Qid" 0
|
||||
#}
|
||||
return $Qid
|
||||
}
|
||||
|
||||
# Obsolete remains only to process legacy item on old queue
|
||||
proc ::detectads::dequeue_and_process {} {
|
||||
set queue_db [::detectads::create_queue_db]
|
||||
|
||||
# loop until queue is empty - mymsman 150418
|
||||
while {1} {
|
||||
|
||||
# Check for and delete any oprhaned files
|
||||
::detectads::delete_orphans
|
||||
|
||||
# get the first eligible item on the queue
|
||||
set result [$queue_db query {SELECT id, file, retry FROM queue WHERE start <= '%s' ORDER BY id ASC LIMIT 1} [clock seconds]]
|
||||
|
||||
if {[llength $result] > 0} {
|
||||
foreach row $result {
|
||||
set id $row(id)
|
||||
set file $row(file)
|
||||
set retrynumb $row(retry)
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
if {[file isfile $file]} {
|
||||
# process it
|
||||
log "Processing item $id ($file) from the queue" 1
|
||||
set ts [ts fetch $file]
|
||||
# choose chase detect if not decrypted - mymsman 150507
|
||||
if {[$ts flag "ODEncrypted"]} {
|
||||
::detectads::chaserun $ts $id $retrynumb
|
||||
} else {
|
||||
::detectads::run $ts
|
||||
}
|
||||
} else {
|
||||
log "Cannot process item $id ($file) from the queue - file does not exist" 1
|
||||
}
|
||||
|
||||
# remove it from the queue
|
||||
log "Removing item $id ($file) from the queue" 1
|
||||
::detectads::delete_entry_queue_db_byId $queue_db $id
|
||||
log "=============================================================" 1
|
||||
} else break
|
||||
}
|
||||
|
||||
# Kill database and chrontab entry if nothing left for the future
|
||||
set result [$queue_db query {SELECT id, file, retry FROM queue ORDER BY id ASC LIMIT 1} ]
|
||||
if {[llength $result] == 0} {exec /mod/webif/plugin/detectads/killdb }
|
||||
|
||||
$queue_db close
|
||||
}
|
||||
|
||||
proc ::detectads::run {ts} {
|
||||
set file [$ts get file]
|
||||
|
||||
@ -487,13 +328,6 @@ proc ::detectads::run {ts} {
|
||||
set bname [file rootname [file tail $file]]
|
||||
set bpath [file dirname $file]
|
||||
|
||||
# Check file has been decrypted - mymsman 1500405
|
||||
if {[$ts flag "ODEncrypted"]} {
|
||||
log " Error! file $file has not been decrypted"
|
||||
return {"FAIILED" "NotDecrypted"}
|
||||
}
|
||||
|
||||
|
||||
foreach {key value} [array get ::opts] {
|
||||
set $key $value
|
||||
}
|
||||
@ -557,7 +391,6 @@ proc ::detectads::run {ts} {
|
||||
if {$bmend} {
|
||||
ladd bookmarks $totalEndSeconds
|
||||
} else {
|
||||
# ladd bookmarks $totalStartSeconds $totalEndSeconds
|
||||
# "Invert" first bookmark position to be correct for manually run nicesplice crop (from xyz321)
|
||||
if {$cropcmd eq " "} {
|
||||
# First bookmark
|
||||
@ -890,7 +723,6 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} {
|
||||
set ftime [clock format $stime -format "%Y%m%d%H%M.%S"]
|
||||
exec touch $tfile -t $ftime
|
||||
set tts [ts fetch $tfile]
|
||||
#set tfilesize [file size $tfile] ;# Restart point
|
||||
set tfilesize 0 ;# Silence/nsplice cant handle restart midway so force total file retrieval
|
||||
|
||||
if {$crop} {
|
||||
@ -932,7 +764,6 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} {
|
||||
# cpulimit if program exists
|
||||
if {$cpulimit > 0 & [file exists /mod/bin/cpulimit]} {
|
||||
set curppid [lindex $pids 2]
|
||||
#set curppid [pid]
|
||||
sleep 3; # mustn't be too quick
|
||||
exec /mod/bin/cpulimit -l $cpulimit -p $curppid &
|
||||
log "ffmpeg pid $curppid limited to $cpulimit % of cpu"
|
||||
@ -981,7 +812,6 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} {
|
||||
if {$bmend} {
|
||||
ladd bookmarks $totalEndSeconds
|
||||
} else {
|
||||
# ladd bookmarks $totalStartSeconds $totalEndSeconds
|
||||
# "Invert" first bookmark position to be correct for manually run nicesplice crop (from xyz321)
|
||||
if {$cropcmd eq " "} {
|
||||
# First bookmark
|
||||
@ -1097,10 +927,6 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} {
|
||||
$ts setbookmarks $bookmarks
|
||||
$tts setbookmarks $bookmarks
|
||||
|
||||
## Replace symlink with copy of updated file
|
||||
#file delete "$tpath/$tname.nts"
|
||||
#file copy -force "[file rootname $file].nts" "$tpath/$tname.nts"
|
||||
|
||||
# Delete links to input from /mod/tmp
|
||||
$its delete
|
||||
|
||||
@ -1218,11 +1044,6 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} {
|
||||
# remove temporary entryt from the queue
|
||||
log "Removing item $tempQid ($file) from the queue" 1
|
||||
{queue delete_by_id} $tempQid
|
||||
|
||||
#set queue_db [sqlite3.open /mod/etc/detectads_queue.db]
|
||||
#::detectads::delete_entry_queue_db_byId $queue_db $tempQid
|
||||
#$queue_db close
|
||||
|
||||
}
|
||||
|
||||
set elapsedSeconds [elapsed $start]
|
||||
|
@ -12,7 +12,6 @@ set fileok 0
|
||||
if {[file exists "$file"] } {
|
||||
set hand [open $file]
|
||||
set data [read $hand 20]
|
||||
#puts "data $data"
|
||||
if {[string length $data] > 0} { set fileok 1}
|
||||
close $hand
|
||||
}
|
||||
@ -21,6 +20,3 @@ if {! $fileok} {
|
||||
file copy -force [file tail $file] $file
|
||||
puts 'Initialized $file'
|
||||
}
|
||||
|
||||
#cd /mod/webif/html/edit
|
||||
#puts [exec /mod/webif/html/edit/edit.jim]
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB |
@ -1,9 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
|
||||
set queue_db [sqlite3.open /mod/etc/detectads_queue.db]
|
||||
$queue_db query {CREATE TABLE IF NOT EXISTS queue(id INTEGER PRIMARY KEY AUTOINCREMENT, file TEXT)}
|
||||
catch {$queue_db query {ALTER TABLE queue ADD COLUMN start INTEGER DEFAULT 0} }
|
||||
catch {$queue_db query {ALTER TABLE queue ADD COLUMN retry INTEGER DEFAULT 0} }
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export tmpf=/tmp/cronf.$$
|
||||
|
||||
# delete chrontab entry
|
||||
crontab=/mod/bin/crontab
|
||||
if [ -x $crontab ]; then
|
||||
$crontab -l | grep -v /mod/webif/plugin/detectads/detectads > $tmpf
|
||||
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
|
||||
fi
|
||||
|
||||
[ -f $tmpf ] && rm -f $tmpf
|
||||
|
||||
# Remove queue data base
|
||||
[ -f /mod/etc/detectads_queue.db ] && rm /mod/etc/detectads_queue.db
|
||||
|
||||
exit 0
|
||||
|
@ -27,7 +27,6 @@ proc ::detectads::dequeue {q ts} {
|
||||
}
|
||||
|
||||
if {[$ts flag "ODEncrypted"]} {
|
||||
#return {"DEFER" "Not yet decrypted"}
|
||||
set rc [::detectads::chaserun $ts [$q get id] [$q get retries] ]
|
||||
} else {
|
||||
set rc [::detectads::run $ts]
|
||||
@ -37,4 +36,3 @@ proc ::detectads::dequeue {q ts} {
|
||||
}
|
||||
|
||||
::auto::register detectads 200
|
||||
|
||||
|
@ -6,8 +6,6 @@ require settings.class
|
||||
|
||||
httpheader
|
||||
|
||||
|
||||
#set detwrec [cgi_get detectads_detwrec no ]
|
||||
set auto [cgi_get detectads_auto no ]
|
||||
set crop [cgi_get detectads_crop no ]
|
||||
set bmend [cgi_get detectads_bmend no ]
|
||||
@ -19,12 +17,6 @@ set tgtchoice [cgi_get detectads_tgtchoice 1]
|
||||
set queue_time [cgi_get detectads_queue_time 0]
|
||||
set cpulimit [cgi_get detectads_cpulimit 0]
|
||||
|
||||
#if {$detwrec eq "yes" && $auto eq "yes"} {
|
||||
# puts "Specify only one Auto process option"
|
||||
# puts "Settings NOT saved."
|
||||
# return
|
||||
#}
|
||||
|
||||
set val 1
|
||||
if {$auto ne "detwrec"} { set val 0 }
|
||||
[settings new] _nval_setting "detectads_detwrec" $val
|
||||
@ -53,4 +45,3 @@ if {$delorig ne "yes"} { set val 0 }
|
||||
[settings new] _nval_setting "detectads_cpulimit" $cpulimit
|
||||
|
||||
puts "Settings saved."
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
|
||||
proc ::sweeper::detectadsq {ts flag folder} {
|
||||
set ret [exec /mod/webif/plugin/detectads/detectads -qq [$ts get file]]
|
||||
log " DetectAds Q search result: $ret" 2
|
||||
if {$ret eq "Not found"} {
|
||||
return 0
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
return $ret
|
||||
}
|
||||
|
||||
proc ::sweeper::action_detectads {ts icmd arg folder} {
|
||||
log "Queuing [$ts get file] for detectads" 0
|
||||
if {!$::sweeper::dryrun} {
|
||||
set cmd [list /mod/webif/plugin/detectads/detectads -aq [$ts get file] ]
|
||||
append cmd $arg
|
||||
log $cmd 2
|
||||
log [exec {*}$cmd] 2
|
||||
#log [exec /mod/webif/plugin/detectads/detectads -aq [$ts get file] [lindex $arg ] ] 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -1,22 +1,6 @@
|
||||
|
||||
schema.criterion.flag.select.Addetection = 'Ad-detection done';
|
||||
|
||||
schema.criterion.detectadsq = {
|
||||
'class': 'file',
|
||||
type: 'noarg',
|
||||
desc: 'Queued for detectads (obsolete -use Recording queued for)',
|
||||
idesc: 'Not queued for detectads (obsolete -use Recording queued for)',
|
||||
negate: true,
|
||||
def: ""
|
||||
};
|
||||
|
||||
schema.action.detectads = {
|
||||
'class': 'file',
|
||||
argtype: 'string',
|
||||
desc: 'Add to detectads queue (obsolete -use Queue recording for)',
|
||||
continues: true
|
||||
};
|
||||
|
||||
register_queue('detectads', 'Ad-detection');
|
||||
|
||||
macros.detectads = {
|
||||
|
@ -1,68 +0,0 @@
|
||||
[
|
||||
{
|
||||
"raw": "!flag Addetection or {filename -crop filename -dec } action {flag detectads}",
|
||||
"name": "Flag old detectads files (not needed for files processed by da >= 0.2.1-0)",
|
||||
"type": "file",
|
||||
"enabled": "0",
|
||||
"criteria": [
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "flag",
|
||||
"arg": "Addetection"
|
||||
},
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "or",
|
||||
"arg": "filename -crop filename -dec ",
|
||||
"criteria": [
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "filename",
|
||||
"arg": "-crop"
|
||||
},
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "filename",
|
||||
"arg": "-dec"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"action": {
|
||||
"cmd": "flag",
|
||||
"arg": "detectads"
|
||||
}
|
||||
},
|
||||
{
|
||||
"raw": "bookmarks 0 !flag Addetection !textmatch %channel~~BBC* !detectadsq {} action detectads",
|
||||
"name": "Queue for DetectAds (add/remove/modify conditions as needed)",
|
||||
"type": "file",
|
||||
"enabled": "0",
|
||||
"criteria": [
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "bookmarks",
|
||||
"arg": "0"
|
||||
},
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "flag",
|
||||
"arg": "Addetection"
|
||||
},
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "textmatch",
|
||||
"arg": "%channel~~BBC*"
|
||||
},
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "detectadsq",
|
||||
"arg": ""
|
||||
}
|
||||
],
|
||||
"action": {
|
||||
"cmd": "detectads",
|
||||
"arg": ""
|
||||
}
|
||||
}
|
||||
]
|
@ -1,4 +0,0 @@
|
||||
# Flag old detectads files (not needed for files processed by da >= 0.2.1-0)
|
||||
## !flag Addetection or {filename -crop filename -dec } action {flag detectads}
|
||||
# Queue for DetectAds (add/remove/modify conditions as needed)
|
||||
## bookmarks 0 !flag Addetection !textmatch %channel~~BBC* !detectadsq "" action detectads
|
@ -1,68 +0,0 @@
|
||||
[
|
||||
{
|
||||
"raw": "!flag Addetection or {filename -crop filename -dec } action {flag detectads}",
|
||||
"name": "Flag old detectads files (not needed for files processed by da >= 0.2.1-0)",
|
||||
"type": "global",
|
||||
"enabled": "0",
|
||||
"criteria": [
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "flag",
|
||||
"arg": "Addetection"
|
||||
},
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "or",
|
||||
"arg": "filename -crop filename -dec ",
|
||||
"criteria": [
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "filename",
|
||||
"arg": "-crop"
|
||||
},
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "filename",
|
||||
"arg": "-dec"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"action": {
|
||||
"cmd": "flag",
|
||||
"arg": "detectads"
|
||||
}
|
||||
},
|
||||
{
|
||||
"raw": "bookmarks 0 !flag Addetection !textmatch %channel~~BBC* !detectadsq {} action detectads",
|
||||
"name": "Queue for DetectAds (add/remove/modify conditions as needed)",
|
||||
"type": "global",
|
||||
"enabled": "0",
|
||||
"criteria": [
|
||||
{
|
||||
"negate": 0,
|
||||
"cmd": "bookmarks",
|
||||
"arg": "0"
|
||||
},
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "flag",
|
||||
"arg": "Addetection"
|
||||
},
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "textmatch",
|
||||
"arg": "%channel~~BBC*"
|
||||
},
|
||||
{
|
||||
"negate": 1,
|
||||
"cmd": "detectadsq",
|
||||
"arg": ""
|
||||
}
|
||||
],
|
||||
"action": {
|
||||
"cmd": "detectads",
|
||||
"arg": ""
|
||||
}
|
||||
}
|
||||
]
|
@ -23,15 +23,3 @@ if {![file exists $file]} {
|
||||
set ts [ts fetch $file]
|
||||
if {$ts eq "0"} exit
|
||||
::detectads::delete_entry_queue_db $ts
|
||||
|
||||
#set result [::detectads::list_queue_db]
|
||||
#if {[llength $result] > 0} {
|
||||
# foreach row $result {
|
||||
# set id $row(id)
|
||||
# set file $row(file)
|
||||
#
|
||||
# log "$id : $file "
|
||||
# }
|
||||
#} else {
|
||||
# log "Queue empty"
|
||||
#}
|
||||
|
@ -64,9 +64,7 @@ puts "
|
||||
</table>
|
||||
<div id=buttons>
|
||||
"
|
||||
#set ret [exec /mod/webif/plugin/detectads/detectads -qq [$ts get file]]
|
||||
set ret [{queue check} $ts detectads]
|
||||
#puts ">$ret<"
|
||||
if {!$ret} {
|
||||
puts "
|
||||
<button id=run>Run Analysis now</button>
|
||||
@ -96,15 +94,3 @@ Analysing recording, please wait...
|
||||
<img src=/img/loading.gif> Still working, please be patient...
|
||||
</div>
|
||||
"
|
||||
#puts "
|
||||
#</div>
|
||||
#<div id=daQueue>
|
||||
#<p>DetectAds Background processing queue:
|
||||
#<pre>
|
||||
#"
|
||||
#puts [exec /mod/webif/plugin/detectads/detectads -lq]
|
||||
#puts "
|
||||
#</pre>
|
||||
#</div>
|
||||
#"
|
||||
|
||||
|
@ -29,16 +29,3 @@ set otheropts [cgi_get opts ""]
|
||||
set ts [ts fetch $file]
|
||||
if {$ts eq "0"} exit
|
||||
::detectads::queue $ts $queue_time
|
||||
|
||||
#set result [::detectads::list_queue_db]
|
||||
#if {[llength $result] > 0} {
|
||||
# foreach row $result {
|
||||
# set id $row(id)
|
||||
# set file $row(file)
|
||||
# set start [ clock format $row(start) -format %T ]
|
||||
#
|
||||
# log "$id : $file $start"
|
||||
# }
|
||||
#} else {
|
||||
# log "Queue empty"
|
||||
#}
|
||||
|
@ -20,16 +20,3 @@ exec hmt "-detectads" "$file"
|
||||
exec hmt "+clearbookmarks" "$file"
|
||||
|
||||
puts "Reset complete"
|
||||
|
||||
#set result [::detectads::list_queue_db]
|
||||
#if {[llength $result] > 0} {
|
||||
# foreach row $result {
|
||||
# set id $row(id)
|
||||
# set file $row(file)
|
||||
# set start [ clock format $row(start) -format %T ]
|
||||
#
|
||||
# log "$id : $file $start"
|
||||
# }
|
||||
#} else {
|
||||
# log "Queue empty"
|
||||
#}
|
||||
|
@ -23,10 +23,8 @@ if {![file exists $file]} {
|
||||
set otheropts [cgi_get opts ""]
|
||||
set debug 0
|
||||
|
||||
# puts "File, $file"
|
||||
# validate parameters
|
||||
::detectads::checkopts $otheropts
|
||||
# puts "File, $file"
|
||||
|
||||
set ts [ts fetch $file]
|
||||
if {$ts eq "0"} exit
|
||||
@ -35,4 +33,3 @@ if {[$ts flag "ODEncrypted"]} {
|
||||
} else {
|
||||
::detectads::run $ts
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,6 @@ $(function() {
|
||||
}
|
||||
}).on('click', function() {
|
||||
window,history.back();
|
||||
//window.location = '/browse/index.jim?dir=' +
|
||||
// encodeURIComponent(dir);
|
||||
});
|
||||
|
||||
function loaddata(data, isfinal) {
|
||||
|
Loading…
Reference in New Issue
Block a user