#!/mod/bin/jimsh package require cgi source /mod/var/mongoose/lib/pretty_size puts "Content-Type: text/html" puts "" cgi_input #cgi_dump #set _cgi(file) "/media/My Video/Dangermouse/Series 1/01_rogue_robots.avi" if {![dict exists $_cgi file]} { exit } set file [dict get $_cgi file] set type [dict get $_cgi type] file stat $file st set sz [pretty_size $st(size)] if {$type eq "ts"} { source /mod/var/mongoose/lib/epg.class source /mod/var/mongoose/lib/ts.class set ts [ts fetch $file] puts " " if {[$ts flag "Guidance"] > 0} { puts " " } puts " " lassign [$ts dlnaloc] url if {$url ne ""} { puts "" } puts " " puts "
Title [$ts get title]
Synopsis [$ts get synopsis]
Guidance [$ts get guidance]
Definition " if {[$ts get definition] eq "HD"} { puts "" } else { puts "" } puts "
Channel [epg channelicon [$ts get channel_name] 50 "vertical-align: middle"] [$ts get channel_num] - [$ts get channel_name]
Start Time " puts [clock format [$ts get start] -format "%c %Z"] puts "(Scheduled: [ clock format [$ts get schedstart] -format "%c %Z"])" puts "
End Time " puts [clock format [$ts get end] -format "%c %Z"] puts "(Scheduled: [clock format \ [expr [$ts get schedstart] + [$ts get scheddur]] \ -format "%c %Z"])" puts "
Duration [$ts duration] minute(s). (Scheduled: [expr [$ts get scheddur] / 60])
Size $sz
DLNA URL $url
Flags [$ts get flags] " if {[$ts get bookmarks]} { puts " \[Bookmarks: [$ts get bookmarks]\]" } puts "
" exit } # Otherwise, for a general file. puts "
File $file
Size $sz
Info Loading...
" set url "/cgi-bin/browse/ffmpeg.jim?file=[cgi_quote_url $file]" puts { }