1a7cb41a16
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@730 2a923420-c742-0410-a762-8d5b09965624
44 lines
918 B
Plaintext
Executable File
44 lines
918 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/var/mongoose/lib/setup
|
|
require epg.class system.class
|
|
|
|
puts "Content-Type: text/html"
|
|
puts ""
|
|
|
|
cgi_input
|
|
#cgi_dump
|
|
|
|
if {![dict exists $_cgi service] || ![dict exists $_cgi event]} {
|
|
puts "Error, insufficient parameters passed."
|
|
exit
|
|
}
|
|
|
|
set service $_cgi(service)
|
|
set event $_cgi(event)
|
|
set type 1
|
|
if {[dict exists $_cgi type]} { set type $_cgi(type) }
|
|
|
|
set event [lindex [epg fetch dump -service $service -event $event] 0]
|
|
if {$event eq ""} {
|
|
puts "Error, cannot find event to schedule."
|
|
exit
|
|
}
|
|
if {[$event percent] > 0} {
|
|
puts "Error, cannot record programme which has already started showing"
|
|
puts "or occurred in the past."
|
|
exit
|
|
}
|
|
|
|
set r [rsv construct $event $type]
|
|
if {[catch {$r insert} msg]} {
|
|
puts "Error encountered while scheduling: <i>$msg</i>"
|
|
} else {
|
|
puts "Successfully scheduled <i>[$event get name]</i>"
|
|
system restartpending
|
|
}
|
|
|
|
epg cleanup
|
|
|