-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'epg.lua') post=AssertPost() key=post and GetSearchKey(post) or GetSearchKeyPreset(mg.request_info.query_string) or GetSearchKeyKeyword(mg.request_info.query_string) edcb.htmlEscape=15 b=key.enabled and SearchEpg(key) or {} st={} for i,v in ipairs(b)do _endTime=TimeWithZone(v.startTime)+(v.durationSecond or 0) if baseTime<_endTime and (i==1 or v.eid~=b[i-1].eid) then if not lastendTime or lastendTime<_endTime then lastendTime=_endTime end for j=1, #st+1 do if st[j] then w=st[j][#st[j]] startTime=TimeWithZone(w.startTime) endTime=w.durationSecond and startTime+w.durationSecond or startTime+10*3600 else st[j]={} end if #st[j]==0 or startTime48 then ONE_MIN_PX=math.max(math.floor(ONE_MIN_PX/4),1) end MAX_ONE_MIN_PX=math.floor(ONE_MIN_PX*1.5+0.5) SERVICE={} for i,v in ipairs(edcb.GetServiceList() or {}) do SERVICE[('%04X%04X%04X'):format(v.onid, v.tsid, v.sid)]=v.service_name end ct={ title=EdcbHtmlEscape(key.title or key.preset or post and '検索 ('..ParseAndKey(key.andKey).andKey..')' or ''), css=EpgCssTemplate(), menu=EpgMenuTemplate(), searchlinks=not SIDE_PANEL } ct.subheader='
\n' ..'
\n' ..'
\n' ..'\n' ..'\n' ..'\n' ..'
\n' ..EpgJsTemplate() ct=Template(ct) mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len,ct.gzip)..'\r\n'))