2011-11-27 23:29:14 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-11-27 23:29:14 +00:00
|
|
|
require ts.class pretty_size
|
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
httpheader
|
2011-11-27 23:29:14 +00:00
|
|
|
|
2011-11-28 15:24:38 +00:00
|
|
|
cgi_input 1
|
2011-11-27 23:29:14 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
|