-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append([=[ 設定/録画保存フォルダ - EDCB

設定/録画保存フォルダ

]=]) commonIni='Common.ini' post=AssertPost() if post and not ALLOW_SETTING then post=nil ct:Append('
変更は許可されていません
\n') end if post then itemList=EdcbRecFolderPathList() item=mg.get_var(post,'dir') or '' if mg.get_var(post,'add') then for i,v in ipairs(itemList) do if v:upper()==item:upper() then --既にある item=nil break end end if item and item:find('^[^%c*?"<>|]+$') then ff=edcb.FindFile(item,1) if ff and ff[1].isdir or item:find('^[A-Za-z]:\\$') then itemList[#itemList+1]=item ct:Append('
追加しました
\n') end end else for i,v in ipairs(itemList) do if v==item then if mg.get_var(post,'del') then table.remove(itemList,i) ct:Append('
削除しました
\n') elseif mg.get_var(post,'up') and i>1 then table.remove(itemList,i) table.insert(itemList,i-1,v) ct:Append('
移動しました
\n') elseif mg.get_var(post,'down') and i<#itemList then table.remove(itemList,i) table.insert(itemList,i+1,v) ct:Append('
移動しました
\n') end break end end end for i,v in ipairs(itemList) do if #itemList==1 and v:upper()==EdcbSettingPath():upper() then --既定値なので記録しない itemList={} break end edcb.WritePrivateProfile('SET','RecFolderPath'..(i-1),v,commonIni) end edcb.WritePrivateProfile('SET','RecFolderNum',#itemList,commonIni) for i=#itemList+1,999 do --掃除 if edcb.GetPrivateProfile('SET','RecFolderPath'..(i-1),'',commonIni)=='' then break end edcb.WritePrivateProfile('SET','RecFolderPath'..(i-1),nil,commonIni) end edcb.ReloadSetting(false) end edcb.htmlEscape=15 for i,v in ipairs(EdcbRecFolderPathList()) do ct:Append([=[
]=]..v..[=[
]=]) end ct:Append([=[ (空き容量が少ない場合、上から順に録画対象のフォルダとします)

(フォルダは事前に作成してください)
]=]) ct:Finish() mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len)..(ct.gzip and 'Content-Encoding: gzip\r\n' or '')..'\r\n'))