update for new channel icons

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1611 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2013-07-11 22:13:36 +00:00
parent e82d303c95
commit b379bb64dc
9 changed files with 64 additions and 45 deletions

View File

@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 1.0.3-1
Version: 1.0.4
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.6),mongoose(>=3.0-9),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.1),smartmontools,tmenu(>=1.05),ffmpeg,id3v2
Depends: webif-channelicons(>=1.1.0),mongoose(>=3.0-9),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.1),smartmontools,tmenu(>=1.05),ffmpeg,id3v2
Suggests:
Description: An evolving web interface for the Humax.

View File

@ -19,7 +19,7 @@ fi
ana=$PKG_ROOT/etc/anacrontab
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
cat $tmpf - << EOM > $ana
1 8 sched_backup /mod/webife/cgi-bin/backup/backup.jim
1 8 sched_backup /mod/webif/cgi-bin/backup/backup.jim
1 5 diskattrs /mod/webif/lib/bin/diskattrs
EOM

View File

@ -67,7 +67,7 @@ foreach tw [$db query {
"BBC ONE" { set mux "PSB1/BBC A" }
"ITV1" { set mux "PSB2/D3&amp;4" }
"ITV" { set mux "PSB2/D3&amp;4" }
"BBC One HD" { set mux "PSB3/BBC B (HD)" }
"BBC ONE HD" { set mux "PSB3/BBC B (HD)" }
"ITV3" { set mux "COM4/SDN" }
"Dave" { set mux "COM5/ARQ A" }
"Film4" { set mux "COM6/ARQ B" }

View File

@ -1,45 +1,12 @@
#!/mod/bin/jimsh
package require cgi
package require pack
source /mod/webif/lib/setup
require ts.class hexdump
require ts.class
httpheader
set dir [cgi_get dir]
if {![file isdirectory $dir]} { exit }
if {![file exists "$dir/.series"]} { exit }
set tot 0
set watched 0
foreach file [readdir -nocomplain $dir] {
if {![string match {*.ts} $file]} { continue }
#puts "FILE: $file"
incr tot
if {[set ts [ts fetch "$dir/$file"]] != 0} {
if {![$ts flag "New"]} { incr watched }
}
}
set fd [open "$dir/.series"]
set bytes [read $fd]
close $fd
set recs [unpack $bytes -uintle 0 32]
set played [unpack $bytes -uintle 32 32]
puts "Current: $played/$recs"
#hexdump $bytes
puts "Calculated: $watched/$tot"
pack bytes $tot -intle 32 0
pack bytes $watched -intle 32 32
#hexdump $bytes
set fd [open "$dir/.series" "w"]
puts -nonewline $fd $bytes
close $fd
ts resetnew $dir

View File

@ -26,6 +26,7 @@ puts "<fieldset style=\"display: inline\">
"
loadseries $dir
set recalc 0
foreach file [readdir $dir] {
set file "$dir/$file"
if {[file extension $file] ne ".hmt"} { continue }
@ -52,6 +53,7 @@ foreach file [readdir $dir] {
}
ts renamegroup $file "_duplicates/$fn"
puts -nonewline " - Renamed to _duplicates/$fn"
incr recalc
}
}
error {
@ -78,6 +80,8 @@ foreach file [readdir $dir] {
puts "</tr>"
}
if {$recalc} { ts resetnew $dir }
puts {
</table>
</fieldset>

View File

@ -23,7 +23,8 @@ puts {
Use the <i>Open</i> button below to begin.
</div>
<textarea cols=80 rows=20 id=editor></textarea>
<textarea cols=80 rows=20 id=editor
class="ui-widget ui-corner-all"></textarea>
<br>
<button class=xeditactive id=open>Open</button>

View File

@ -60,7 +60,7 @@ proc register {type fn} {
}
}
proc runplugin {name ts} {
proc runplugin {name {ts 0}} {
set var "hook_$name"
global $var
foreach p [subst $$var] {
@ -127,6 +127,15 @@ if {[system pkginst undelete]} {
log "Dustbin: $dustbin" 2
set recalc 0
proc dorecalc {dir} {
global recalc
if {!$recalc} return
ts resetnew $dir
set recalc 0
}
proc dedup {dir} {
log "DEDUP: \[$dir]" 2
loop i 0 1 {
@ -156,6 +165,7 @@ proc do_expire {ts} {
log " EXPIRE: $file ($age > $ax_days)" 0
log " Deleted." 0
runplugin postexpire $ts
incr ::recalc
}
}
}
@ -531,6 +541,8 @@ proc scan {dir attr {force 0}} {{indent 0}} {
}
}
dorecalc $dir
incr indent -2
}
@ -545,9 +557,9 @@ if {[llength $argv] > 0} {
} else {
foreach arg $modules {
set st [clock milliseconds]
runplugin "pre${arg}scan" 0
runplugin "pre${arg}scan"
scan $root $arg
runplugin "post${arg}scan" 0
runplugin "post${arg}scan"
log "$arg scan completed in [elapsed $st] seconds."
}
}

View File

@ -119,7 +119,7 @@ epg method type_icon {} {
}
proc {epg channelicon} {name {width 0} {style ""}} {
set str "<img src=\"/img/channels/$name.png\"";
set str "<img src=\"/img/channels/out/$name.png\"";
if {$width > 0} { append str " width=$width" }
if {$style ne ""} { append str " style=\"$style\" }
append str " alt=\"\">"
@ -127,7 +127,7 @@ proc {epg channelicon} {name {width 0} {style ""}} {
}
epg method channel_icon {{width 0} {style ""}} {
set str "<img src=\"/img/channels/$channel_name.png\"";
set str "<img src=\"/img/channels/out/$channel_name.png\"";
if {$width > 0} { append str " width=$width" }
if {$style ne ""} { append str " style=\"$style\" }
append str " alt=\"\">"

View File

@ -1,5 +1,6 @@
if {![exists -proc class]} { package require oo }
if {![exists -proc pack]} { package require pack }
source /mod/webif/lib/setup
require tdelete system.class
@ -333,3 +334,37 @@ proc {ts genrelist} {} {
}
}
proc {ts resetnew} {dir} {
if {![file isdirectory $dir]} return
if {![file exists "$dir/.series"]} return
set tot 0
set watched 0
foreach file [readdir -nocomplain $dir] {
if {![string match {*.ts} $file]} { continue }
incr tot
if {[set ts [ts fetch "$dir/$file"]] != 0} {
if {![$ts flag "New"]} { incr watched }
}
}
set fd [open "$dir/.series"]
set bytes [read $fd]
close $fd
set recs [unpack $bytes -uintle 0 32]
set played [unpack $bytes -uintle 32 32]
#puts "Current: $played/$recs"
#hexdump $bytes
#puts "Calculated: $watched/$tot"
pack bytes $tot -intle 32 0
pack bytes $watched -intle 32 32
#hexdump $bytes
set fd [open "$dir/.series" "w"]
puts -nonewline $fd $bytes
close $fd
}