2011-06-22 23:36:30 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
|
|
|
require pretty_size
|
2011-06-22 23:36:30 +00:00
|
|
|
|
|
|
|
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"} {
|
2012-05-21 20:23:41 +00:00
|
|
|
require epg.class ts.class
|
2011-06-22 23:36:30 +00:00
|
|
|
|
|
|
|
set ts [ts fetch $file]
|
|
|
|
|
|
|
|
puts "
|
|
|
|
<table class=keyval>
|
|
|
|
<tr>
|
|
|
|
<th>Title</th>
|
|
|
|
<td>[$ts get title]</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>Synopsis</th>
|
|
|
|
<td>[$ts get synopsis]</td>
|
|
|
|
</tr><tr>
|
2011-06-27 19:57:32 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
if {[$ts flag "Guidance"] > 0} {
|
|
|
|
puts "
|
|
|
|
<th>Guidance</th>
|
|
|
|
<td><img class=va
|
|
|
|
src=/images/174_1_26_GuidancePolicy.png height=21>
|
|
|
|
[$ts get guidance]
|
|
|
|
</td>
|
|
|
|
</tr><tr>
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "
|
2011-06-22 23:36:30 +00:00
|
|
|
<th>Definition</th>
|
|
|
|
<td>
|
|
|
|
"
|
|
|
|
if {[$ts get definition] eq "HD"} {
|
|
|
|
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
|
|
|
} else {
|
|
|
|
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
|
|
|
}
|
|
|
|
puts "</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>Channel</th>
|
|
|
|
<td>[epg channelicon [$ts get channel_name] 50 "vertical-align: middle"]
|
|
|
|
[$ts get channel_num] - [$ts get channel_name]</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>Start Time</th>
|
|
|
|
<td>"
|
|
|
|
puts [clock format [$ts get start] -format "%c %Z"]
|
2011-12-27 18:43:40 +00:00
|
|
|
puts "<font class=also>(Scheduled: [
|
|
|
|
clock format [$ts get schedstart] -format "%c %Z"])</font>"
|
2011-06-22 23:36:30 +00:00
|
|
|
puts "</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>End Time</th>
|
|
|
|
<td>"
|
|
|
|
puts [clock format [$ts get end] -format "%c %Z"]
|
2011-12-27 18:43:40 +00:00
|
|
|
puts "<font class=also>(Scheduled: [clock format \
|
|
|
|
[expr [$ts get schedstart] + [$ts get scheddur]] \
|
|
|
|
-format "%c %Z"])</font>"
|
2011-06-22 23:36:30 +00:00
|
|
|
puts "</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>Duration</th>
|
2011-12-27 18:43:40 +00:00
|
|
|
<td>[$ts duration] minute(s).
|
|
|
|
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
|
|
|
|
</font></td>
|
2011-06-22 23:36:30 +00:00
|
|
|
</tr><tr>
|
|
|
|
<th>Size</th>
|
|
|
|
<td>$sz</td>
|
2011-10-11 19:51:58 +00:00
|
|
|
"
|
2012-01-22 19:47:47 +00:00
|
|
|
lassign [$ts dlnaloc] url
|
|
|
|
if {$url ne ""} {
|
2011-11-03 23:43:17 +00:00
|
|
|
puts "</tr><tr><th>DLNA URL</th>
|
|
|
|
<td><a href=\"$url\">$url</a></td>"
|
2011-10-11 19:51:58 +00:00
|
|
|
}
|
|
|
|
puts "
|
2011-06-22 23:36:30 +00:00
|
|
|
</tr><tr>
|
|
|
|
<th>Flags</th>
|
2011-11-03 23:43:17 +00:00
|
|
|
<td>[$ts get flags]
|
|
|
|
"
|
|
|
|
if {[$ts get bookmarks]} {
|
|
|
|
puts " \[Bookmarks: [$ts get bookmarks]\]"
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "</tr>"
|
|
|
|
puts "</table>"
|
2011-06-22 23:36:30 +00:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
# Otherwise, for a general file.
|
|
|
|
|
|
|
|
puts "
|
|
|
|
<table class=keyval>
|
|
|
|
<tr>
|
|
|
|
<th>File</th>
|
|
|
|
<td>$file</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>Size</th>
|
|
|
|
<td>$sz</td>
|
|
|
|
</tr><tr>
|
|
|
|
<th>Info</th>
|
|
|
|
<td class=pre id=ffmpeg>
|
|
|
|
<img src=/img/loading.gif><i>Loading...</i>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
"
|
|
|
|
|
|
|
|
set url "/cgi-bin/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
|
|
|
|
puts { <script type="text/javascript"> }
|
|
|
|
puts "var url = \"$url\";"
|
|
|
|
puts {
|
|
|
|
$('#ffmpeg').load(url);
|
|
|
|
</script>
|
|
|
|
}
|
|
|
|
|