#!/mod/bin/jimsh package require cgi source /mod/webif/lib/setup require 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"} { require epg.class 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
Files " set fileset [$ts fileset] puts -nonewline "" puts -nonewline "[llength $fileset] file" if {[llength $fileset] != 1} { puts -nonewline "s" } puts -nonewline " in set." puts "" puts "
Flags [$ts get flags] " if {[$ts get bookmarks]} { puts " \[Bookmarks: [$ts get bookmarks]\]" } puts "
" 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 { }