-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append(DOCTYPE_HTML4_STRICT..[=[ 設定/EPG取得対象サービス - EDCB

設定/EPG取得対象サービス

]=]) post=AssertPost() if post and not ALLOW_SETTING then post=nil ct:Append('
変更は許可されていません
\n') end if post then f=edcb.io.open(PathAppend(EdcbSettingPath(),'ChSet5.txt'),'r+b') if f and not WIN32 and not edcb.io._flock_nb(f) then --排他ロックできなかった f:close() f=nil end if f then fsize=f:seek('end') txt=nil if fsize then f:seek('set') txt=f:read('*a') if txt and #txt~=fsize then txt=nil end end if txt then txt=txt:gsub('[^\n]*',function(s) --8列目がEPG取得フラグ local i,j,onid,tsid,sid=s:find('^[^\t]*\t[^\t]*\t([0-9]+)\t([0-9]+)\t([0-9]+)\t[0-9]+\t[0-9]+\t[01]\t') return i and s:sub(1,j-2)..(GetVarInt(post,onid..'-'..tsid..'-'..sid,1,1) or 0)..s:sub(j) end) --サイズは変化しないのでそのまま上書き f:seek('set') f:write(txt) f:flush() end if not WIN32 then --ほっといても解除されるが一応 edcb.io._flock_nb(f,'u') end f:close() if txt then ct:Append('
変更しました
\n') edcb.ReloadSetting(false) end end end edcb.htmlEscape=15 ct:Append([=[
]=]) for i,v in ipairs(edcb.GetChDataList()) do ct:Append(' \n') end ct:Append([=[
サービス名NetworkServiceIDType
'..NetworkType(v.onid)..('%d(0x%04x)'):format(v.sid,v.sid)..v.serviceType..'

]=]) ct:Finish() mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len,ct.gzip)..'\r\n'))