EPG予約 条件変更
\n- \n'
..'
- プリセット
- \n' ..' \n' ..'
- 条件
- \n' ..' \n') if aa.dataID~=0 then ct:Append('
- -
- \n' ..' \n') end ct:Append('
-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') function AddOrChange(dataID,post) local aa={dataID=dataID} local presetID=GetVarInt(post,'presetID',0,65534) if presetID then for i,v in ipairs(edcb.EnumRecPresetInfo()) do if v.id==presetID then aa.recSetting=v.recSetting break end end elseif dataID~=0 then for i,v in ipairs(edcb.EnumAutoAdd()) do if v.dataID==dataID then aa.recSetting=v.recSetting break end end end if aa.recSetting then local useMargin=GetVarInt(post,'useDefMarginFlag')~=1 or nil aa.recSetting={ batFilePath=aa.recSetting.batFilePath, recFolderList=aa.recSetting.recFolderList, partialRecFolder=aa.recSetting.partialRecFolder, recMode=GetVarInt(post,'recEnabled')~=1 and 5 or GetVarInt(post,'recMode',0,4), noRecMode=GetVarInt(post,'recMode',0,4), tuijyuuFlag=GetVarInt(post,'tuijyuuFlag')==1, priority=GetVarInt(post,'priority',1,5), pittariFlag=GetVarInt(post,'pittariFlag')==1, suspendMode=GetVarInt(post,'suspendMode',0,4), rebootFlag=GetVarInt(post,'rebootFlag')==1, startMargin=useMargin and GetVarInt(post,'startMargin',-6*3600,6*3600), endMargin=useMargin and GetVarInt(post,'endMargin',-6*3600,6*3600), serviceMode=GetVarInt(post,'serviceMode')==1 and 0 or 1+16*(GetVarInt(post,'serviceMode_1',0,1) or 0)+32*(GetVarInt(post,'serviceMode_2',0,1) or 0), continueRecFlag=GetVarInt(post,'continueRecFlag')==1, tunerID=GetVarInt(post,'tunerID'), partialRecFlag=GetVarInt(post,'partialRecFlag',0,1) or 0 } if aa.recSetting.recMode and aa.recSetting.priority and aa.recSetting.suspendMode and (not useMargin or aa.recSetting.startMargin and aa.recSetting.endMargin) and aa.recSetting.tunerID then aa.searchInfo={ --制御文字は消す andKey=(GetVarInt(post,'disableFlag')==1 and '^!{999}' or '') ..(GetVarInt(post,'caseFlag')==1 and 'C!{999}' or '') ..(mg.get_var(post,'andKey') or ''):gsub('%c',''), notKey=(mg.get_var(post,'notKey') or ''):gsub('%c',''), regExpFlag=GetVarInt(post,'regExpFlag')==1, titleOnlyFlag=GetVarInt(post,'titleOnlyFlag')==1, aimaiFlag=GetVarInt(post,'aimaiFlag')==1, notContetFlag=GetVarInt(post,'notContetFlag')==1, notDateFlag=GetVarInt(post,'notDateFlag')==1, freeCAFlag=GetVarInt(post,'freeCAFlag',0,2) or 0, chkRecEnd=GetVarInt(post,'chkRecEnd')==1, chkRecDay=GetVarInt(post,'chkRecDay') or 0, chkRecNoService=GetVarInt(post,'chkRecNoService')==1, chkDurationMin=GetVarInt(post,'chkDurationMin') or 0, chkDurationMax=GetVarInt(post,'chkDurationMax') or 0 } aa.searchInfo.contentList={} for i=0,10000 do local v=GetVarInt(post,'contentList',0,65535,i) if not v then break end table.insert(aa.searchInfo.contentList,{content_nibble=v}) end aa.searchInfo.serviceList={} for i=0,10000 do local v=mg.get_var(post,'serviceList',i) if not v then break end local m={v:match('^(%d?%d?%d?%d?%d)%-(%d?%d?%d?%d?%d)%-(%d?%d?%d?%d?%d)$')} if #m==3 then table.insert(aa.searchInfo.serviceList,{onid=0+m[1],tsid=0+m[2],sid=0+m[3]}) end end aa.searchInfo.dateList={} for v in (mg.get_var(post,'dateList') or ''):gmatch('[^,]+') do local m={v:match('^ *([a-z][a-z])[a-z](%d?%d):(%d?%d)%-([a-z][a-z])[a-z](%d?%d):(%d?%d) *$')} if #m==6 then local dateInfo={ startDayOfWeek=({su=0,mo=1,tu=2,we=3,th=4,fr=5,sa=6})[m[1]], startHour=0+m[2], startMin=0+m[3], endDayOfWeek=({su=0,mo=1,tu=2,we=3,th=4,fr=5,sa=6})[m[4]], endHour=0+m[5], endMin=0+m[6] } if dateInfo.startDayOfWeek and dateInfo.startHour<24 and dateInfo.startMin<60 and dateInfo.endDayOfWeek and dateInfo.endHour<24 and dateInfo.endMin<60 then table.insert(aa.searchInfo.dateList,dateInfo) end end end return edcb.AddOrChgAutoAdd(aa) end end return false end ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append([=[