Compare commits

...

2 Commits

Author SHA1 Message Date
hummypkg
02f7c5aad9 version 0.7.6
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@449 2a923420-c742-0410-a762-8d5b09965624
2011-10-11 19:51:58 +00:00
hummypkg
0fa394eaa1 tweak update all
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@445 2a923420-c742-0410-a762-8d5b09965624
2011-10-07 18:18:45 +00:00
8 changed files with 68 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 0.7.5
Version: 0.7.6
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.5),hmt(>=1.0.6),ssmtp

View File

@@ -10,27 +10,19 @@ require ts.class
cgi_input
#cgi_dump
set file [dict get $_cgi file]
set file [cgi_get file "/media/My Video/Chuggington/Hodge_and_the_Chugnav.ts"]
set rfile [file normalize $file]
set ts [ts fetch $file]
set dmsfile /mnt/hd2/dms_cds.db
# Default to just downloading the raw file.
set url $file
set mime "video/ts"
if {[file exists $dmsfile]} {
set db [sqlite3.open /mnt/hd2/dms_cds.db]
set muri [$db query "
select tblresource.mimetype, contenturi
from tblresource join tblmedia using (mediaid)
where localurl = '%s'" $rfile]
if {$muri != ""} {
set rec [lindex $muri 0]
set xuri [lindex $rec 3]
set mime [lindex $rec 1]
set url "http://$env(HTTP_HOST):9000/web/$xuri"
}
}
# Unless the DLNA option is available.
set dlna [$ts dlnaloc]
if {[llength $dlna]} { lassign $dlna url mime }
puts "DLNA: $dlna"
puts "Content-Type: text/plain"
puts "Refresh: 0; url=$url"

View File

@@ -77,6 +77,12 @@ if {$type eq "ts"} {
</tr><tr>
<th>Size</th>
<td>$sz</td>
"
set dlna [$ts dlnaloc]
if {[llength $dlna]} {
puts "</tr><tr><th>DLNA&nbsp;URL</th><td>[lindex $dlna 0]</td>"
}
puts "
</tr><tr>
<th>Flags</th>
<td>[$ts get flags]</td>

View File

@@ -9,17 +9,24 @@ cgi_input
set cmd [cgi_get cmd update]
proc opkg {cmd} {
chunk ">>> opkg $cmd\r\n"
set bcmd "|/mod/var/mongoose/lib/opkg $cmd"
set fd [open $bcmd r]
while {[gets $fd line] >= 0} {
chunk "$line\r\n"
#chunk_pad
}
close $fd
chunk "\r\n"
}
start_chunked
set bcmd "|/mod/var/mongoose/lib/opkg $cmd"
set fd [open $bcmd r]
while {[gets $fd line] >= 0} {
chunk "$line\r\n"
#chunk_pad
}
close $fd
if {$cmd eq "upgrade"} { opkg update }
opkg $cmd
if {$cmd eq "update"} {
if {$cmd eq "update" || $cmd eq "upgrade"} {
chunk "Updating package meta information\r\n"
pkg fetchmeta
chunk "Done.\r\n"

View File

@@ -1,7 +1,7 @@
puts {
<!-- start of topbar -->
<div class=container onclick="location.href='/'; return false;">
<div id=topbar class=container onclick="location.href='/'; return false;">
<div class=left><img src=/images/154_1_00_WIN_MD116_1L.png></div>
<div class=middle>
<!-- Start include diskspace - above other items to work around IE feature.. -->
@@ -19,6 +19,12 @@ puts {
</div>
<div class=right><img src=/images/154_1_00_WIN_MD116_3R.png></div>
</div>
<script type=text/javascript>
$('#topbar').hover(
function() { $(this).css('cursor', 'pointer'); },
function() { $(this).css('cursor', 'auto'); }
);
</script>
<!-- end of topbar -->
}

View File

@@ -1,6 +1,6 @@
<!-- start of topbar -->
<div class=container onclick="location.href='/'; return false;">
<div id=topbar class=container onclick="location.href='/'; return false;">
<div class=left><img src=/images/154_1_00_WIN_MD116_1L.png></div>
<div class=middle>
<!-- Start include diskspace - above other items to work around IE feature.. -->
@@ -13,5 +13,11 @@
</div>
<div class=right><img src=/images/154_1_00_WIN_MD116_3R.png></div>
</div>
<script type=text/javascript>
$('#topbar').hover(
function() { $(this).css('cursor', 'pointer'); },
function() { $(this).css('cursor', 'auto'); }
);
</script>
<!-- end of topbar -->

View File

@@ -3,11 +3,7 @@
set services [split [exec /mod/bin/service mlist]]
foreach service $services {
set data [split $service ":"]
set name [lindex $data 0]
set installed [lindex $data 1]
set auto [lindex $data 2]
set running [lindex $data 3]
lassign [split $service ":"] name installed auto running
puts "<tr><td class=even>$name</td>"
if (!$installed) {

View File

@@ -1,6 +1,8 @@
if {![exists -proc class ]} { package require oo }
set dmsfile /mnt/hd2/dms_cds.db
class ts {
file ""
base ""
@@ -125,6 +127,27 @@ ts method settitle {newtitle} {
exec /mod/bin/hmt "+settitle=${newtitle}" $file
}
ts method dlnaloc {} {
set mime "video/ts"
if {![file exists $::dmsfile]} { return {} }
if {[catch {set db [sqlite3.open $::dmsfile]}]} { return {} }
set url ""
set rfile [file normalize $file]
set muri [$db query "
select tblresource.mimetype, contenturi
from tblresource join tblmedia using (mediaid)
where localurl = '%s'" $rfile]
if {$muri ne ""} {
set rec [lindex $muri 0]
set xuri [lindex $rec 3]
set mime [lindex $rec 1]
set url "http://$::env(HTTP_HOST):9000/web/$xuri"
}
$db close
if {$url ne "" } { return [list $url $mime] } else { return {} }
}
proc {ts renamegroup} {from to} {
set dir [file dirname $from]
set root [file rootname $from]