#!/mod/bin/jimsh

package require cgi
source /mod/webif/lib/setup
require ts.class json

httpheader "application/json"

set file [cgi_get file]
if {$file == 0} exit
set ts [ts fetch $file]
if {$ts == 0} exit

puts "{"
puts "\"title\" : \"[jescape [$ts get title]]\","
puts "\"synopsis\" : \"[jescape [$ts get synopsis]]\","
puts "\"guidance\" : \"[jescape [$ts get guidance]]\","
puts "\"genre\" : [jescape [$ts genrenib]],"
puts "\"seriesnum\" : [jescape [$ts get seriesnum]],"
puts "\"episodenum\" : [jescape [$ts get episodenum]],"
puts "\"episodetot\" : [jescape [$ts get episodetot]]"
puts "}"

