From 7643a92550ca4d23641a478758aa367c34df54e2 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 12 Jul 2011 18:57:30 +0000 Subject: [PATCH] scheduling updates git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@267 2a923420-c742-0410-a762-8d5b09965624 --- var/mongoose/cgi-bin/db.jim | 46 +++++++++++++++++++------ var/mongoose/cgi-bin/epg_schedule.jim | 34 +++++++++++------- var/mongoose/cgi-bin/restart.jim | 5 +-- var/mongoose/cgi-bin/transmission.jim | 13 +++++++ var/mongoose/html/db.shtml | 4 --- var/mongoose/html/img/transmission.png | Bin 0 -> 5970 bytes var/mongoose/html/index.shtml | 3 +- var/mongoose/html/lib/header.jim | 2 ++ var/mongoose/html/lib/header.shtml | 2 ++ var/mongoose/html/pkg.shtml | 8 +++-- var/mongoose/include/backup.jim | 1 - var/mongoose/include/db.jim | 45 ------------------------ var/mongoose/include/mediatomb.jim | 2 +- var/mongoose/include/restart.jim | 2 +- var/mongoose/include/sched.jim | 12 ++++++- var/mongoose/include/transmission.jim | 21 +++++++++++ var/mongoose/lib/epg_popup | 34 +++++++++--------- 17 files changed, 136 insertions(+), 98 deletions(-) create mode 100755 var/mongoose/cgi-bin/transmission.jim delete mode 100644 var/mongoose/html/db.shtml create mode 100644 var/mongoose/html/img/transmission.png delete mode 100755 var/mongoose/include/db.jim create mode 100755 var/mongoose/include/transmission.jim diff --git a/var/mongoose/cgi-bin/db.jim b/var/mongoose/cgi-bin/db.jim index 8f85ace..84880a5 100755 --- a/var/mongoose/cgi-bin/db.jim +++ b/var/mongoose/cgi-bin/db.jim @@ -1,23 +1,48 @@ #!/mod/bin/jimsh +package require cgi package require sqlite3 source /mod/var/mongoose/lib/setup require altrow +puts "Content-Type: text/html" +puts "" + +header + +cgi_input +#cgi_dump + +set ftab [cgi_get tab] +set fdb [cgi_get db] + +if {$fdb != 0} { + puts "

Remove filters

" +} + proc db_info {db_file} { + global _cgi fdb ftab + + if {$fdb != 0 && [file tail $db_file] ne $fdb} { return } if {![file exists $db_file]} { return } + set db [sqlite3.open $db_file] - set tables [$db query {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name}] - - puts "

$db_file

" + set tables [$db query { + select name from sqlite_master + where type='table' order by name + }] + + puts "

+ $db_file

" foreach table $tables { - set table_name [lindex $table 1] - set columns [$db query "pragma table_info($table_name)"] - set datas [$db query "SELECT * FROM $table_name"] + set table [lindex $table 1] + if {$ftab != 0 && $ftab ne $table} { continue } + set columns [$db query "pragma table_info($table)"] + set datas [$db query "SELECT * FROM $table order by 1"] - puts "

$table_name

" - puts "" + puts "

$table

" + puts "
" puts " " foreach column $columns { puts " " @@ -37,9 +62,10 @@ proc db_info {db_file} { $db close } -puts {} db_info /var/lib/humaxtv/rsv.db db_info /var/lib/humaxtv/setup.db db_info /var/lib/humaxtv/channel.db -#db_info /mnt/hd2/dms_cds.db +db_info /mnt/hd2/dms_cds.db + +footer diff --git a/var/mongoose/cgi-bin/epg_schedule.jim b/var/mongoose/cgi-bin/epg_schedule.jim index 184be43..902e549 100755 --- a/var/mongoose/cgi-bin/epg_schedule.jim +++ b/var/mongoose/cgi-bin/epg_schedule.jim @@ -10,9 +10,9 @@ puts "" cgi_input #cgi_dump -#set _cgi(service) 4351 -#set _cgi(event) 41795 -#set _cgi(type) 1 +#set _cgi(service) 4170 +#set _cgi(event) 38584 +#set _cgi(type) 2 if {![dict exists $_cgi service] || ![dict exists $_cgi event]} { puts "Error, insufficient parameters passed." @@ -30,7 +30,8 @@ if {$event eq ""} { exit } if {[$event percent] > 0} { - puts "Error, cannot record programme which has already started showing." + puts "Error, cannot record programme which has already started showing" + puts "or occurred in the past." exit } @@ -46,27 +47,36 @@ set args(usevtid) [$event get event_id] set args(szevtname) "\025[$event get name]" set args(eReady) 30 +set ccrid [$event get channel_crid] + if {$type == 1} { # Event - set args(ucCRIDType) 49 - set args(ucRecKind) 1 - set args(szCRID) "[$event get channel_crid][$event get event_crid]" + set args(ucCRIDType) 49 + set args(ucRecKind) 1 + set args(szCRID) "$ccrid[$event get event_crid]" set args(szEventToRecord) "1$args(szCRID)|" } else { # Series - set args(ucCRIDType) 50 - set args(ucRecKind) 4 - set args(szCRID) "[$event get channel_crid][$event get series_crid]" + set args(ucCRIDType) 50 + set args(ucRecKind) 4 + set args(szCRID) "$ccrid[$event get series_crid]" set args(szFPBRecPath) "$args(szevtname)" + set progs [lmap i [epg fetch dump -scrid [$event get series_crid]] { + if {[set ecrid [$i get event_crid]] eq ""} { continue } + list "1$::ccrid$ecrid" + }] + set args(szEventToRecord) "[join $progs "|"]|" } +#puts $args + set msg "" -#set msg "Testing" +if {![file exists /mod/.schedule.testing]} { set msg "Disabled during testing" } if {$msg ne "" || [catch {[rsv new $args] insert} msg]} { puts "Error encountered while scheduling the recording: $msg" } else { puts "Successfully scheduled recording of [$event get name]" - #close [open /tmp/.restartpending w] + close [open /tmp/.restartpending w] } epg cleanup diff --git a/var/mongoose/cgi-bin/restart.jim b/var/mongoose/cgi-bin/restart.jim index 8f2fd37..258a38e 100755 --- a/var/mongoose/cgi-bin/restart.jim +++ b/var/mongoose/cgi-bin/restart.jim @@ -3,6 +3,7 @@ puts "Content-Type: text/html" puts "" -puts [exec /etc/init.d/S90settop restart] -file delete /tmp/.restartpending +#puts [exec /etc/init.d/S90settop restart] +#file delete /tmp/.restartpending +puts [exec killall humaxtv] diff --git a/var/mongoose/cgi-bin/transmission.jim b/var/mongoose/cgi-bin/transmission.jim new file mode 100755 index 0000000..09ce464 --- /dev/null +++ b/var/mongoose/cgi-bin/transmission.jim @@ -0,0 +1,13 @@ +#!/mod/bin/jimsh + +set url "http://$env(HTTP_HOST):9091/" + +puts "Content-Type: text/html +Location: $url + + + +Transmission is available here + +" + diff --git a/var/mongoose/html/db.shtml b/var/mongoose/html/db.shtml deleted file mode 100644 index 9fa5fb8..0000000 --- a/var/mongoose/html/db.shtml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/var/mongoose/html/img/transmission.png b/var/mongoose/html/img/transmission.png new file mode 100644 index 0000000000000000000000000000000000000000..8314bd4f2b3a71141cc7e778ba413007fc214206 GIT binary patch literal 5970 zcmV-Y7p>@tP)2?^mPBq0eH-U6-S1Iy#qPSsAeLW?5ys-Ue`>lM9M87ttU z^%koYD#Z{8Rf&j@0P+d}gBU_0Xn+us5R#m{bI!TzTl4P;!*J)0LxN2InU#IAv(KJ? zy}tFWwRdb@uNPOYnKm0PU$(1%R}2&=3_ zTu~9~_&t$8pkDwmA{a=B1P1#9eSCnJFd)oVK34;+yMcN2z@8ugUR>My`xW{+(9O%^ z@t~ulLytB;zus;iA0GhWNx%b9z^rH>PL6O=IkO>O8kS;y_W^cq0d8soj&}8i9o?<8 zudi=pNJz--B6A{QVrF9aaEDJtMaQ_xO2=RTE?#ebxXoh^Y1xuRv`T8Pc&>&n04tDH* z{(1Nr&tEiN?;#Rk&IKD|RGZ%i1JjSo=?=hUzmW{!r4d?MP*+=viMQUG676uTEjVys z#6VFrARquvr&Gn>-(P#Zm%DZ#M~8<1p_2am?B1@_N3yL@)Z3X;cy^e$r2pT%|)|B zOsG-5O~h@E9-}zD-C$CM*unFj8^HinzEPxIq!;kZ@xXKEva@^tPCUE#z4s6(UcY$p zBErJLEXA!O{B1T2%*a6P&whr}t5>5B03tk$vc5*zjRC4eO4KlL5kb8_qyf00RCpQsirq8ek)UdxPxuCXX1ZqP-n$ zVo3Y-G=SZNybq9gJCL6aL{iZXQ=Tq~3>Wb?*S46yQK49o>_7cU4Io?q*19C9UtC;_ z5&_G4F+!ynrM>f>%=II6z^&fU&~si%8_5@l^>9S+q(vyUuI|Qwc2kOKHKZ~1UUAA4 zqr8tPPaa-(1u$|onD51loY}q|`$So;Z@&2k|NQ4a@&5boq{l5f8SB8a+@usA-I3`S3=omWmF;8G%YHM2?yyAUaFANwkeLB3t?#|ZM`eYUs zu1%BhYcOHnV#2k*QTmKIUt_?l#TYNbfMWh9pTI7j+p%pMxU>}jv|*~Ns{_NkB_iU9 znx>}z3Q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BWAAkH1fTu-v5#@i7{}?e{ z;ujgR_HshRAx2Czjujn)G$6R^uDi5bbg1`@;&vaB95t4ZDna%g_`0|lQPEK>X>wl6 z8I8q(3iDn^;P1Wno=0BX*d;msHwKHy*&E?sW-jIDPQd(EQuE@AFJkW8xdK=bxKLRs?5#q30PDITadB!i z1xve~;jR>S*sx)wuUNi(S;?V81)DDexb_?IpQcXk+rK|2DQWm(vN0;cC?KghCFSXr zS6(4v^BhClfZHHqgEi|TGh`%?`|C@TufP8KdBKGb0c;c@k9T#;dxBjhg@uJ1&z?K$ z;=2JHQ!&>W&at9sTznjv9-~4ZZt5c~@wmB$qCG@Hd^~ctY;irZWXT7jyajMOE#+@y z15ozJ1CU&KgG&b^W|5W>{%8Q!bd3Tp&%526DQZV3_`%Vd`|&59*uHN4`o$6rOHHm{ zLN_i4x^}sxiPE67~3UMiyLVDFKmjIeOz_*@c;k-07*qoM6N<$f@Bk5 A&j0`b literal 0 HcmV?d00001 diff --git a/var/mongoose/html/index.shtml b/var/mongoose/html/index.shtml index 90a3757..6c8f2b1 100644 --- a/var/mongoose/html/index.shtml +++ b/var/mongoose/html/index.shtml @@ -106,11 +106,12 @@ $(document).ready(function() {
+
[lindex $column 3]
" - puts " " - foreach column $columns { - puts " " - } - puts " " - foreach data $datas { - altrow - - for {set i 1} {$i < [llength $data]} {incr i 2} { - puts " " - } - puts " " - } - puts "
[lindex $column 3]
[lindex $data $i]
" - } - - $db close -} - -puts {} -db_info /var/lib/humaxtv/rsv.db -db_info /var/lib/humaxtv/setup.db -db_info /var/lib/humaxtv/channel.db -#db_info /mnt/hd2/dms_cds.db - diff --git a/var/mongoose/include/mediatomb.jim b/var/mongoose/include/mediatomb.jim index c213d83..34db931 100755 --- a/var/mongoose/include/mediatomb.jim +++ b/var/mongoose/include/mediatomb.jim @@ -12,7 +12,7 @@ puts "
- +
diff --git a/var/mongoose/include/restart.jim b/var/mongoose/include/restart.jim index 61cd171..f1db4ab 100755 --- a/var/mongoose/include/restart.jim +++ b/var/mongoose/include/restart.jim @@ -7,7 +7,7 @@ puts {
- A warm restart is required in order to complete a scheduling operation. + A restart is required in order to complete a scheduling operation.
} diff --git a/var/mongoose/include/sched.jim b/var/mongoose/include/sched.jim index d987d34..31c7ebf 100755 --- a/var/mongoose/include/sched.jim +++ b/var/mongoose/include/sched.jim @@ -125,14 +125,24 @@ foreach event $events { puts "
" } puts "" + if {[$event get aulEventToRecordInfo] != ""} { + puts "*" + } puts "" } puts "" puts "Click on the CRID to view episodes." puts { + + + } diff --git a/var/mongoose/include/transmission.jim b/var/mongoose/include/transmission.jim new file mode 100755 index 0000000..52287ef --- /dev/null +++ b/var/mongoose/include/transmission.jim @@ -0,0 +1,21 @@ +#!/mod/bin/jimsh + +if {![file exists /mod/sbin/transmission-daemon]} { exit 0 } + +set url "/cgi-bin/transmission.jim" + +puts " + +" + diff --git a/var/mongoose/lib/epg_popup b/var/mongoose/lib/epg_popup index bd82c6f..d13fab1 100644 --- a/var/mongoose/lib/epg_popup +++ b/var/mongoose/lib/epg_popup @@ -2,30 +2,28 @@ puts {