From 1c58f1ef4c83ef63ed8b35525e461779f4803855 Mon Sep 17 00:00:00 2001 From: MymsMan Date: Tue, 10 Mar 2020 16:33:16 +0000 Subject: [PATCH] Remove references to old detctads queue system --- CONTROL/postinst | 22 +-- CONTROL/prerm | 12 +- etc/recmon.d/rm_detectads | 12 -- webif/plugin/detectads/auto.hook | 9 +- webif/plugin/detectads/browse.js | 5 - webif/plugin/detectads/detectads | 47 ----- webif/plugin/detectads/detectads.jim | 181 +------------------- webif/plugin/detectads/editprep.jim | 4 - webif/plugin/detectads/img/icon.png | Bin 1042 -> 0 bytes webif/plugin/detectads/img/nodetectadsX.png | Bin 2742 -> 0 bytes webif/plugin/detectads/initdb | 9 - webif/plugin/detectads/killdb | 18 -- webif/plugin/detectads/queue.hook | 2 - webif/plugin/detectads/save.jim | 9 - webif/plugin/detectads/sweeper.hook | 25 --- webif/plugin/detectads/sweeper.js | 16 -- webif/plugin/detectads/sweeper.json | 68 -------- webif/plugin/detectads/sweeper.txt | 4 - webif/plugin/detectads/sweeperG.json | 68 -------- webif/plugin/detectads/web/dequeue.jim | 12 -- webif/plugin/detectads/web/index.jim | 14 -- webif/plugin/detectads/web/queue.jim | 13 -- webif/plugin/detectads/web/reset.jim | 13 -- webif/plugin/detectads/web/runnow.jim | 3 - webif/plugin/detectads/web/script.js | 2 - 25 files changed, 4 insertions(+), 564 deletions(-) delete mode 100644 webif/plugin/detectads/img/icon.png delete mode 100644 webif/plugin/detectads/img/nodetectadsX.png delete mode 100755 webif/plugin/detectads/initdb delete mode 100755 webif/plugin/detectads/killdb delete mode 100644 webif/plugin/detectads/sweeper.hook delete mode 100644 webif/plugin/detectads/sweeper.json delete mode 100644 webif/plugin/detectads/sweeper.txt delete mode 100644 webif/plugin/detectads/sweeperG.json diff --git a/CONTROL/postinst b/CONTROL/postinst index 2766b3c..f4f41da 100755 --- a/CONTROL/postinst +++ b/CONTROL/postinst @@ -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 - diff --git a/CONTROL/prerm b/CONTROL/prerm index 1c8cd68..774ee77 100755 --- a/CONTROL/prerm +++ b/CONTROL/prerm @@ -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 - diff --git a/etc/recmon.d/rm_detectads b/etc/recmon.d/rm_detectads index 71a040e..4370c4c 100755 --- a/etc/recmon.d/rm_detectads +++ b/etc/recmon.d/rm_detectads @@ -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 } - - - diff --git a/webif/plugin/detectads/auto.hook b/webif/plugin/detectads/auto.hook index 99966d3..9581bf3 100644 --- a/webif/plugin/detectads/auto.hook +++ b/webif/plugin/detectads/auto.hook @@ -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 - diff --git a/webif/plugin/detectads/browse.js b/webif/plugin/detectads/browse.js index feffb9f..039b797 100644 --- a/webif/plugin/detectads/browse.js +++ b/webif/plugin/detectads/browse.js @@ -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); }; - - diff --git a/webif/plugin/detectads/detectads b/webif/plugin/detectads/detectads index 37922c2..f14663c 100755 --- a/webif/plugin/detectads/detectads +++ b/webif/plugin/detectads/detectads @@ -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" - # } - # } diff --git a/webif/plugin/detectads/detectads.jim b/webif/plugin/detectads/detectads.jim index 11029f9..0c0ca85 100755 --- a/webif/plugin/detectads/detectads.jim +++ b/webif/plugin/detectads/detectads.jim @@ -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] diff --git a/webif/plugin/detectads/editprep.jim b/webif/plugin/detectads/editprep.jim index 8289bdb..e1bcb48 100755 --- a/webif/plugin/detectads/editprep.jim +++ b/webif/plugin/detectads/editprep.jim @@ -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] diff --git a/webif/plugin/detectads/img/icon.png b/webif/plugin/detectads/img/icon.png deleted file mode 100644 index bbf2d8541e7aa0c7e336d499692aa1b4ba22d17e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1042 zcmZvaUuYCp6vjVIYW$m8i{M5}pC%N+;_gFVbVDi$nVH1pV*XKl(Sc~f*buoQvK3q_ zO=}CYu+Vw1X$VqEnG|7cNi#1Z0TUDnre2{eqr_~o_z>tC1Rs3(yqmY^UhetMy@w0; z{P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F6eanJE8b%&J+qhh8fE=rwEceG9;3x&)<9BBKc#FlihHY-z%&%-j(KSTW$za+nBM@ z9bF3-T8w+Rd>P>ISRgnwu;-Y&TfvqsU%F!TP%JLS8W3bA4tMnnJU*BZ8h$Ok&f&{@ z*rcOys_XT&puAiIa&lGO0->-mCLvZsq7uZpdv{B)V^PYzPJn=*s~{*O09?F$F3)j? z<4&kCS&p%<3E>%#zo7m>TVi+t}EwhA~TSB8WXU2BmDP{iuJS-%tdT4pLHi zqbI#j=r`GK@|ZLLKjf2apvIRD3PO7Cp8j zNV0V-$?*=5mV#kA^V1IDL?U2O+d|iUK zh7rVKdwq-`OxXS*WGQ6X1gII*$fpq049c2`>rWu7`Vd5i&C|SSQOD1Iz5`dTUIHh+ z_b~5p+Rhy_U^NSKAa7N`WNJ9Y!Q*0Ry=@?iAxkDe>;Dl1HT5qH==j&?O9^l`lnAmV w3+CIndE*6_LkFH6{niz1+wLep5M=d#0V_jmQ%h>wl>h($07*qoM6N<$g100df&c&j diff --git a/webif/plugin/detectads/initdb b/webif/plugin/detectads/initdb deleted file mode 100755 index 7a18c62..0000000 --- a/webif/plugin/detectads/initdb +++ /dev/null @@ -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} } - diff --git a/webif/plugin/detectads/killdb b/webif/plugin/detectads/killdb deleted file mode 100755 index bfa03e0..0000000 --- a/webif/plugin/detectads/killdb +++ /dev/null @@ -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 - diff --git a/webif/plugin/detectads/queue.hook b/webif/plugin/detectads/queue.hook index ca463db..83be38a 100644 --- a/webif/plugin/detectads/queue.hook +++ b/webif/plugin/detectads/queue.hook @@ -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 - diff --git a/webif/plugin/detectads/save.jim b/webif/plugin/detectads/save.jim index b84427c..dc4d736 100755 --- a/webif/plugin/detectads/save.jim +++ b/webif/plugin/detectads/save.jim @@ -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." - diff --git a/webif/plugin/detectads/sweeper.hook b/webif/plugin/detectads/sweeper.hook deleted file mode 100644 index e86b9ac..0000000 --- a/webif/plugin/detectads/sweeper.hook +++ /dev/null @@ -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 -} - - diff --git a/webif/plugin/detectads/sweeper.js b/webif/plugin/detectads/sweeper.js index 1a1a68b..bff5ed5 100644 --- a/webif/plugin/detectads/sweeper.js +++ b/webif/plugin/detectads/sweeper.js @@ -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 = { diff --git a/webif/plugin/detectads/sweeper.json b/webif/plugin/detectads/sweeper.json deleted file mode 100644 index e8675d5..0000000 --- a/webif/plugin/detectads/sweeper.json +++ /dev/null @@ -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": "" - } - } -] diff --git a/webif/plugin/detectads/sweeper.txt b/webif/plugin/detectads/sweeper.txt deleted file mode 100644 index c55a4b3..0000000 --- a/webif/plugin/detectads/sweeper.txt +++ /dev/null @@ -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 diff --git a/webif/plugin/detectads/sweeperG.json b/webif/plugin/detectads/sweeperG.json deleted file mode 100644 index a9d4d24..0000000 --- a/webif/plugin/detectads/sweeperG.json +++ /dev/null @@ -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": "" - } - } -] diff --git a/webif/plugin/detectads/web/dequeue.jim b/webif/plugin/detectads/web/dequeue.jim index e4739ef..359e83d 100755 --- a/webif/plugin/detectads/web/dequeue.jim +++ b/webif/plugin/detectads/web/dequeue.jim @@ -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" -#} diff --git a/webif/plugin/detectads/web/index.jim b/webif/plugin/detectads/web/index.jim index 78a79a7..a92c838 100755 --- a/webif/plugin/detectads/web/index.jim +++ b/webif/plugin/detectads/web/index.jim @@ -64,9 +64,7 @@ puts "
" -#set ret [exec /mod/webif/plugin/detectads/detectads -qq [$ts get file]] set ret [{queue check} $ts detectads] -#puts ">$ret<" if {!$ret} { puts " @@ -96,15 +94,3 @@ Analysing recording, please wait... Still working, please be patient...
" -#puts " -# -#
-#

DetectAds Background processing queue: -#

-#"
-#puts [exec /mod/webif/plugin/detectads/detectads -lq]
-#puts "
-#
-#
-#" - diff --git a/webif/plugin/detectads/web/queue.jim b/webif/plugin/detectads/web/queue.jim index 298eebb..9009df3 100755 --- a/webif/plugin/detectads/web/queue.jim +++ b/webif/plugin/detectads/web/queue.jim @@ -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" -#} diff --git a/webif/plugin/detectads/web/reset.jim b/webif/plugin/detectads/web/reset.jim index 8f9b581..05ef529 100755 --- a/webif/plugin/detectads/web/reset.jim +++ b/webif/plugin/detectads/web/reset.jim @@ -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" -#} diff --git a/webif/plugin/detectads/web/runnow.jim b/webif/plugin/detectads/web/runnow.jim index ba37683..3e6806a 100755 --- a/webif/plugin/detectads/web/runnow.jim +++ b/webif/plugin/detectads/web/runnow.jim @@ -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 } - diff --git a/webif/plugin/detectads/web/script.js b/webif/plugin/detectads/web/script.js index c9ecc1c..066c4c5 100644 --- a/webif/plugin/detectads/web/script.js +++ b/webif/plugin/detectads/web/script.js @@ -27,8 +27,6 @@ $(function() { } }).on('click', function() { window,history.back(); - //window.location = '/browse/index.jim?dir=' + - // encodeURIComponent(dir); }); function loaddata(data, isfinal) {