From bfbda4c95892e9d695cdb2427830d78d68f25136 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Sat, 27 Jul 2013 13:01:55 +0200 Subject: Instant record now only records current program. --- History | 1 + index.html | 112 ++++++++++++++++++++++++++++-------------------------------- lang_dut.js | 2 +- lang_eng.js | 2 +- settings.js | 1 - 5 files changed, 56 insertions(+), 62 deletions(-) diff --git a/History b/History index b1da022..ba6bbe3 100644 --- a/History +++ b/History @@ -10,6 +10,7 @@ VDR 1.7.29 Pause Live TV on Server Added a 'none' to audio prio settings, which restores the factory setting. Timer ADD/ Timer DEL is now possible by using SmartTVWeb (Show Timers still uses restfulapi) (No more patching of restfulapi is needed!) + Instant REC now only records current program ( no EPG, no recording ) diff --git a/index.html b/index.html index c3544cc..a218629 100644 --- a/index.html +++ b/index.html @@ -490,7 +490,7 @@ function onKeyDown(event) { } } else if(isSchedule == 0){ if(NowNext) { - settimer(EPG[NowNext][2][currChan],EPG[NowNext][1][currChan],0); + settimer(EPG[NowNext][2][currChan],EPG[NowNext][1][currChan],0,1); switchtimer.style.opacity = 1; setTimeout("switchtimer.style.opacity = 0; ", 2000); } @@ -859,9 +859,7 @@ function onKeyDown(event) { } else if(isSchedule == 0){ if(NowNext) { // // make timer for recording -// SwitchTimer = 2; -// settimer(EPG[NowNext][2][currChan],EPG[NowNext][1][currChan],(EPG[NowNext][3][currChan]*60)); -// SwitchTimer = 1; +// settimer(EPG[NowNext][2][currChan],EPG[NowNext][1][currChan],(EPG[NowNext][3][currChan]*60),2); // switchtimer.style.opacity = 1; // setTimeout("switchtimer.style.opacity = 0; ", 2000); } else { @@ -1036,7 +1034,8 @@ function updateOSDtime(timchan) { } -function settimer(ProgTime,ProgName,ProgDura) { +function settimer(ProgTime,ProgName,ProgDura,SwitchTimer) { +// 1 - switchonly, 2 - record on server (display info only), 3 - record local if(SwitchTimer == 1) { try { switchtimerID = toi.schedulerService.schedule("SwitchOnly","notification", ProgTime , 0); @@ -2195,6 +2194,7 @@ function LoadTimers() { function LoadTimersServer_1() { +//Get timers from SmartTVweb try { xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET",(recServ + "/timers.xml?" + new Date().getTime()),false); @@ -2202,7 +2202,7 @@ try { xmlDoc=xmlhttp.responseXML; var x=xmlDoc.getElementsByTagName("timer"); maxTimers = x.length; - for (var i=0;i<(x.length+10);i++) { timers[i] = 0 ;} // clear timers[i] tries to clear crap if current x.length < previous x.length + timers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length for (var i=0;i timersflag[0] etc) + + } catch(e) { timerOK = 0; alert("Get Timers problem: " + e); @@ -2239,7 +2242,7 @@ try { } } -function DeleteTimers() { +function DeleteTimers_1() { try { xmlhttp=new XMLHttpRequest(); @@ -2261,7 +2264,23 @@ try { } +function DeleteTimers() { +try { + alert(timersID[timerID]); + xmlhttp=new XMLHttpRequest(); + xmlhttp.open("POST",(RestFulAPI + "/timers/" + timersID[timerID]),false); + xmlhttp.send(); + alert(xmlhttp.responseText); + + } catch(e) { + alert("Deleting Timers problem: " + e); + } +} + + + function LoadTimersServer() { +//Get timers from RestFulApi try { xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET",(RestFulAPI + "/timers.xml?" + new Date().getTime()),false); @@ -2269,7 +2288,7 @@ try { xmlDoc=xmlhttp.responseXML; var x=xmlDoc.getElementsByTagName("timer"); maxTimers = x.length; - for (var i=0;i<(x.length+10);i++) { timers[i] = "" ;} // clear timers[i] tries to clear crap if current x.length < previous x.length + timers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length for (var i=0;i