-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') ct={title='チューナー別',tab=''} if (not SIDE_PANEL) then ct.css='\n' ct.js='\n' end pageCount=tonumber(edcb.GetPrivateProfile('SET','PAGE_COUNT','30',INI)) tab=GetVarInt(mg.request_info.query_string,'tab') or 1 edcb.htmlEscape=15 ctt={} for i,v in ipairs(edcb.GetTunerReserveAll()) do ct.tab=ct.tab..''..i..':'..v.tunerName..' ('..#v.reserveList..')\n' if i==tab then a={} for j,w in ipairs(v.reserveList) do table.insert(a, edcb.GetReserveData(w)) end table.sort(a, function(a,b) return os.time(a.startTime) < os.time(b.startTime) end) page=GetVarInt(mg.request_info.query_string,'page',0,(#a-1)/pageCount) or 0 if pageCount==0 then pageCount=#a end pageNav=Pagination(page, a) table.insert(ctt, '
'..pageNav..'
' ..'\n' ..'\n' ..'\n\n' ..' \n') for i=page*pageCount+1,math.min(#a,(page+1)*pageCount) do w=a[i] size=GetPredictionSize(w) table.insert(ctt, '' ..'\n
'..#a..' 件中 '..math.min(#a,page*pageCount+1)..' - '..math.min(#a,(page+1)*pageCount)..' 件
録画\n' ..' 日付\n' ..' 番組名\n' ..' サービス\n' ..' コメント\n' ..' 予想サイズ\n' ..' 優先度\n' ..'
' ..'\n '..FormatTimeAndDuration(w.startTime, w.durationSecond) ..'\n '..ConvertTitle(w.title) ..'\n '..w.stationName ..'\n '..w.comment ..'\n '..(size and ('%.1fGB'):format(size/1024/1024/1024) or '-') ..'\n priority_high'..w.recSetting.priority ..'\n') end table.insert(ctt, '
\n
\n'..ThumbContainerTemplate()..pageNav..'
\n') end end ct.main='
\n' ..SidePanelTemplate(true) ..table.concat(ctt) ..'' ct=Template(ct) mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len,ct.gzip)..'\r\n'))