diff --git a/CONTROL/control b/CONTROL/control index f97e09a..5ec0973 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: detectads Priority: optional Section: misc -Version: 0.3.0 +Version: 0.3.0-1 Architecture: mipsel Maintainer: mymsman (Created by njm) -Depends: webif(>=1.4.0), chaseget(>=0.1.2-1), nicesplice(>=1.7), ffmpeg, libsndfile (>=1.0.25-2), procps,stripts(>=1.4.5) +Depends: webif(>=1.4.0), chaseget(>=0.1.3), nicesplice(>=1.7), ffmpeg, libsndfile (>=1.0.25-2), procps,stripts(>=1.4.5) Description: Automatically detects adverts and inserts bookmarks or deletes adverts. Can run whilst recording is still in progress diff --git a/CONTROL/postinst b/CONTROL/postinst index f4f41da..2652aa0 100755 --- a/CONTROL/postinst +++ b/CONTROL/postinst @@ -1,6 +1,6 @@ #!/bin/sh -## nothing to do - +## Set link +ln -f /mod/webif/plugin/detectads/detectads /mod/bin/detectads exit 0 diff --git a/CONTROL/prerm b/CONTROL/prerm index 774ee77..8a6c3f1 100755 --- a/CONTROL/prerm +++ b/CONTROL/prerm @@ -1,4 +1,5 @@ #!/bin/sh -# nothing to do +# remove program links +rm /mod/bin/detectads exit 0 diff --git a/webif/plugin/detectads/detectads.jim b/webif/plugin/detectads/detectads.jim index 5b2aa34..49a543e 100755 --- a/webif/plugin/detectads/detectads.jim +++ b/webif/plugin/detectads/detectads.jim @@ -14,14 +14,14 @@ proc ::detectads::delete_entry_queue_db {ts} { #delete ophans that haven't been modified in an hour or are for the current recording proc ::detectads::delete_orphans {file} { - if {![catch {exec /mod/bin/pgrep -x chaseget }]} {return} + #if {![catch {exec /mod/bin/pgrep -x chaseget }]} {return} set bname [file rootname [file tail $file]] set fl [glob -nocomplain "/mod/tmp/*-inp.ts" "/mod/tmp/*-dec.ts"] log "orphan file list $fl" 2 foreach f $fl { set fname [file tail [string range $f 0 end-7]] - log "$bname $fname [clock format [file mtime $f]]" 0 + log "$bname $fname [clock format [file mtime $f]]" 2 if {[file mtime $f]+3600 < [clock seconds] || $bname == $fname} { safedel $f "/orphans" @@ -706,13 +706,13 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} { log "starting" 2 # Create links to input in tmp for retrieval - file delete -force "$ipath/$iname.ts" - catch {file link -hard "$ipath/$iname.ts" "[file normalize [file rootname $file].ts]"} - file delete -force "$ipath/$iname.nts" - catch {file link -hard "$ipath/$iname.nts" "[file normalize [file rootname $file].nts]"} - file delete -force "$ipath/$iname.hmt" - catch {file link -hard "$ipath/$iname.hmt" "[file normalize [file rootname $file].hmt]"} - set its [ts fetch $ifile] + # file delete -force "$ipath/$iname.ts" + # catch {file link -hard "$ipath/$iname.ts" "[file normalize [file rootname $file].ts]"} + # file delete -force "$ipath/$iname.nts" + # catch {file link -hard "$ipath/$iname.nts" "[file normalize [file rootname $file].nts]"} + # file delete -force "$ipath/$iname.hmt" + # catch {file link -hard "$ipath/$iname.hmt" "[file normalize [file rootname $file].hmt]"} + # set its [ts fetch $ifile] # Use link for .nts so updates are visble @@ -764,10 +764,10 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} { if {!$dirdecrypt} { # Use chaseget for decryption - set decrypt "/mod/bin/chaseget {$ifile} $tfilesize" + set decrypt "/mod/bin/chaseget {$file} $tfilesize" } else { # Use stripts for decryption - set decrypt "/mod/bin/stripts -@@ {$ipath/$iname} - 2>@$::logfd" + set decrypt "/mod/bin/stripts -@@ {$file} - 2>@$::logfd" } set adDetectOutput [open "|\ @@ -946,7 +946,7 @@ proc ::detectads::chaserun {ts {Qid 0} {retrynumb 0}} { $tts setbookmarks $bookmarks # Delete links to input from /mod/tmp - $its delete + #its delete # Check that complete file has been retrieved & detected set ts [ts fetch $file]