-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'epg.lua') baseDate=math.floor((utc9Now-MARGIN_HOUR*3600)/24/3600) Hour=math.floor(((utc9Now%(24*3600))/3600)-MARGIN_HOUR)%24 baseTime=(baseDate*24+Hour)*3600 post=AssertPost() rt={} for i,v in ipairs(edcb.GetReserveData()) do rt[v.onid..'-'..v.tsid..'-'..v.sid..'-'..v.eid]=v.reserveID end preset=mg.get_var(mg.request_info.query_string, 'preset') Olympic=mg.get_var(mg.request_info.query_string, 'Olympic') _preset=nil presetList={} for v in edcb.GetPrivateProfile('search','list','',ini):gmatch('[^,]+') do if v==preset then _preset=preset..'_Search' end presetList[#presetList+1]=v end if not _preset then --未登録 preset=nil end if preset then key={ andKey=edcb.GetPrivateProfile(_preset,'andKey','',ini), notKey=edcb.GetPrivateProfile(_preset,'notKey','',ini), regExpFlag=tonumber(edcb.GetPrivateProfile(_preset,'regExpFlag',false,ini))~=0, titleOnlyFlag=tonumber(edcb.GetPrivateProfile(_preset,'titleOnlyFlag',false,ini))~=0, aimaiFlag=tonumber(edcb.GetPrivateProfile(_preset,'aimaiFlag',false,ini))~=0, notContetFlag=tonumber(edcb.GetPrivateProfile(_preset,'notContetFlag',false,ini))~=0, notDateFlag=tonumber(edcb.GetPrivateProfile(_preset,'notDateFlag',false,ini))~=0, freeCAFlag=tonumber(edcb.GetPrivateProfile(_preset,'freeCAFlag',0,ini)), chkRecEnd=tonumber(edcb.GetPrivateProfile(_preset,'chkRecEnd',false,ini))~=0, chkRecDay=tonumber(edcb.GetPrivateProfile(_preset,'chkRecDay',0,ini)), chkRecNoService=tonumber(edcb.GetPrivateProfile(_preset,'chkRecNoService',false,ini))~=0, chkDurationMin=tonumber(edcb.GetPrivateProfile(_preset,'chkDurationMin',0,ini)), chkDurationMax=tonumber(edcb.GetPrivateProfile(_preset,'chkDurationMax',0,ini)), days=tonumber(edcb.GetPrivateProfile(_preset,'days',0,ini)), contentList={}, serviceList={}, dateList={}, lock=tonumber(edcb.GetPrivateProfile(_preset,'lock',false,ini))~=0, } for i=0,1000 do v=tonumber(edcb.GetPrivateProfile(_preset,'contentList'..i,0,ini)) if v==0 then break end table.insert(key.contentList, {content_nibble=v}) end for i=0,1000 do v=edcb.GetPrivateProfile(_preset,'serviceList'..i,0,ini) if v==0 then break end m={string.match(v, '^(%d+)%-(%d+)%-(%d+)$')} if #m==3 then table.insert(key.serviceList, {onid=0+m[1], tsid=0+m[2], sid=0+m[3]}) end end for v in string.gmatch(edcb.GetPrivateProfile(_preset,'dateList','',ini), '[^,]+') do m={string.match(v, '^(.-)%-(%d+):(%d+)%-(.-)%-(%d+):(%d+)$')} if #m==6 then dateInfo={ startDayOfWeek=({['日']=0,['月']=1,['火']=2,['水']=3,['木']=4,['金']=5,['土']=6})[m[1]], endDayOfWeek=({['日']=0,['月']=1,['火']=2,['水']=3,['木']=4,['金']=5,['土']=6})[m[4]] } if dateInfo.startDayOfWeek and dateInfo.endDayOfWeek then dateInfo.startHour=0+m[2] dateInfo.startMin=0+m[3] dateInfo.endHour=0+m[5] dateInfo.endMin=0+m[6] table.insert(key.dateList, dateInfo) end end end elseif post then key=getSearchKey(post) elseif Olympic then key={ andKey='(オ|パラ)リンピック|五輪|FIFAワールドカップ', notKey='', regExpFlag=true, titleOnlyFlag=true, chkDurationMin=10, contentList={{content_nibble=262}}, serviceList={}, days=3 } for i,v in ipairs(edcb.GetChDataList()) do if v.searchFlag then table.insert(key.serviceList, v) end end end if not key then key={} end edcb.htmlEscape=15 b=edcb.SearchEpg(key) table.sort(b, function(a,b) if os.time(a.startTime)==os.time(b.startTime) then return a.sid < b.sid else return os.time(a.startTime) < os.time(b.startTime) end end) 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 startTime\n' ..'
\n' ..'
\n' ..'
\n' ..'
\n' ..'
\n' ..'
\n' main={'
\n' ..'\n' ..'\n' ..'\n' ..'\n' ..'\n' ct=template(ct) mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len)..(ct.gzip and 'Content-Encoding: gzip\r\n' or '')..'\r\n'))