2011-11-27 23:29:14 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
|
|
|
source /mod/var/mongoose/lib/setup
|
|
|
|
require ts.class pretty_size
|
|
|
|
|
|
|
|
puts "Content-Type: text/html\r\n\r\n"
|
|
|
|
|
2011-11-28 15:24:38 +00:00
|
|
|
cgi_input 1
|
2011-11-27 23:29:14 +00:00
|
|
|
#cgi_dump
|
|
|
|
|
|
|
|
set joinstart [clock milliseconds]
|
|
|
|
|
|
|
|
set cmd {/mod/bin/nicesplice}
|
2011-11-28 15:24:38 +00:00
|
|
|
set dst [file rootname [cgi_get dest "joined"]]
|
2011-11-27 23:29:14 +00:00
|
|
|
|
|
|
|
foreach file [split [cgi_get files] ","] {
|
2011-11-28 15:24:38 +00:00
|
|
|
set file [cgi_unquote_input $file]
|
2011-11-27 23:29:14 +00:00
|
|
|
lappend cmd "-in" [file rootname $file]
|
|
|
|
set dir [file dirname $file]
|
|
|
|
}
|
2011-11-28 15:24:38 +00:00
|
|
|
lappend cmd "-out" "$dir/$dst"
|
2011-11-27 23:29:14 +00:00
|
|
|
|
|
|
|
puts "($cmd)"
|
|
|
|
puts [exec {*}$cmd]
|
|
|
|
|
2011-11-28 15:24:38 +00:00
|
|
|
set ts [ts fetch "$dir/$dst.ts"]
|
|
|
|
$ts settitle $dst
|
|
|
|
|
2011-11-27 23:29:14 +00:00
|
|
|
set jointime [expr [expr [clock milliseconds] - $joinstart] / 1000.0]
|
|
|
|
puts "Time taken: $jointime"
|
|
|
|
|