1.0.15 & improved status

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1968 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-06-14 09:21:09 +00:00
parent c237f228a8
commit 492b37be41
2 changed files with 68 additions and 24 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.0.14-10
Version: 1.0.15
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.11),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.19),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose

View File

@ -19,6 +19,12 @@ switch $runmode {
}
}
if {"-d" in $argv} {
proc debug {arg} { puts $arg }
} else {
proc debug {arg} {}
}
if {[catch {set pid [exec pgrep -n humaxtv]}]} {
puts "Cannot find humaxtv process."
exit
@ -54,6 +60,9 @@ proc get_data {} {
[string first /media/ $line] == -1} {
continue
}
if {[string first "/.tsr/" $line] != -1} {
continue
}
regsub -- { \([^\)]+\)$} $line "" line
set ext [file extension $line]
if {$ext ni $exts} continue
@ -79,7 +88,6 @@ proc get_data {} {
set play 0
set rec 0
set seen {}
set output {}
set data {}
@ -87,33 +95,69 @@ if {$type eq "full"} {
set data [get_data]
}
if {[llength $data]} {
debug " DATA: ($data)"
if {![file exists /tmp/.rractive]} {
set rr 0
sleep 3
set ndata [get_data]
# puts " DATA: ($data)"
# puts " NDATA: ($ndata)"
foreach file [array names ndata] {
debug " NDATA: ($ndata)"
} else {
set rr 1
set recs {}
loop i 0 2 {
catch {
set fd [open "/tmp/.rec$i" r]
lappend recs "[$fd read -nonewline].ts"
$fd close
}
}
debug " RECS: $recs"
}
foreach file [array names data] {
set bname [file rootname [file tail $file]]
if {![dict exists $seen $file]} { set seen($file) 0 }
if {![dict exists $data $file]} { set data($file) 0 }
if {[file exists "/mod/tmp/webif_auto/decrypting.$bname.ts"]} {
set mode "Decrypting"
set icon "178_1_00_Icon_Lock.png style=\"padding: 0 0.2em 0 0.5em\""
} elseif {$ndata($file) == -1} {
set mode dec
} elseif {$data($file) == -1} {
set mode chase
} elseif {$rr} {
if {$file in $recs} {
set mode rec
} else {
set mode play
}
} else {
if {![dict exists $ndata $file]} continue
if {$ndata($file) > $data($file)} {
set mode rec
} else {
set mode play
}
}
switch $mode {
chase {
incr rec
incr play
set mode "Chase Playing"
set icon "745_1_11_Video_3REC_Live.png"
} elseif {$ndata($file) > $data($file) && $seen($file) < 1} {
}
rec {
incr rec
set mode "Recording"
set icon "745_1_11_Video_1REC.png"
} else {
}
play {
incr play
set mode "Playing"
set icon "745_1_10_Video_2Live.png"
}
incr seen($file)
dec {
set mode "Decrypting"
set icon "178_1_00_Icon_Lock.png "
append icon "style=\"padding: 0 0.2em 0 0.5em\""
}
}
set name [string map {
"/mnt/hd2/My Video/" ""