From 123c9d794d8d4ea43ba1e79cd211e13d988698e5 Mon Sep 17 00:00:00 2001 From: paul kim Date: Thu, 5 Sep 2024 19:25:01 +0900 Subject: [PATCH] issue #10 #11 #12 Fix EPG info time issue. --- .../application/lib/hoteltv.ui_appfull.js | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/procentric/application/lib/hoteltv.ui_appfull.js b/procentric/application/lib/hoteltv.ui_appfull.js index 03502e8..ac57102 100755 --- a/procentric/application/lib/hoteltv.ui_appfull.js +++ b/procentric/application/lib/hoteltv.ui_appfull.js @@ -501,10 +501,10 @@ HotelTV.ui_appfull = (function() { _state.menu.stage.prev = _state.menu.stage.cur; _state.menu.stage.cur = "external_av_hdmi"; _state.external_input.connected = true; - _state.external_input.last_input.index = Number(_evt.index)-1; + _state.external_input.last_input.index = Number(_evt.index); setTimeout(function(){ $('body,html').fadeOut(500, function(){ - let __retSuccess = HotelTV.hal.SetExternalInput("HDMI", Number(_evt.index)-1); + let __retSuccess = HotelTV.hal.SetExternalInput("HDMI", Number(_evt.index)); if ( __retSuccess==false ){ _state.external_input.connected = false; _state.external_input.last_input.index = 0; @@ -4032,32 +4032,42 @@ HotelTV.ui_appfull = (function() { let _rtn_epg = null; for (_j=0; _j<_epg_prom_info.length; _j++) { - let _schTmPrev = new Date(); + let _schTmNext = new Date(); let _schTmCur = new Date(); let _epgProgInf_Cur = _epg_prom_info[_j]; - let _epgProgInf_Prev = null; + let _epgProgInf_Next = null; if (_epgProgInf_Cur.time.length != 5) { console.log("EPG Schedule org time is NULL"); } else { + let __str_playingTime = null; + _schTmCur.setHours(Number(_epgProgInf_Cur.time.charAt(0) + _epgProgInf_Cur.time.charAt(1))); _schTmCur.setMinutes(Number(_epgProgInf_Cur.time.charAt(3) + _epgProgInf_Cur.time.charAt(4))); // EPG shedule정보는 인덱스 0부터 시작 - if ( _j>0 ){ - _epgProgInf_Prev = _epg_prom_info[_j-1]; - _schTmPrev.setHours(Number(_epgProgInf_Prev.time.charAt(0) + _epgProgInf_Prev.time.charAt(1))); - _schTmPrev.setMinutes(Number(_epgProgInf_Prev.time.charAt(3) + _epgProgInf_Prev.time.charAt(4))); + if ( _j<(_epg_prom_info.length-1) ){ + _epgProgInf_Next = _epg_prom_info[_j+1]; + _schTmNext.setHours(Number(_epgProgInf_Next.time.charAt(0) + _epgProgInf_Next.time.charAt(1))); + _schTmNext.setMinutes(Number(_epgProgInf_Next.time.charAt(3) + _epgProgInf_Next.time.charAt(4))); + + __str_playingTime = `${_epgProgInf_Cur.time}~${_epgProgInf_Next.time}`; + } else { + // + _schTmNext.setMinutes(Number(0)); + _schTmNext.setHours(Number(24)); + + __str_playingTime = `${_epgProgInf_Cur.time}~`; } - let _t_playTotal = Math.round((_schTmCur - _schTmPrev) / 60000); //Total play time in minuate - let _t_playRemain = Math.round((_schTmCur - _tm_cur) / 60000); //Remain play time in minuate + let _t_playTotal = Math.round((_schTmNext - _schTmCur) / 60000); //Total play time in minuate + let _t_playRemain = Math.round((_schTmNext - _tm_cur) / 60000); //Remain play time in minuate _rtn_epg = _epgProgInf_Cur; if (_t_playRemain >= 0) { //console.log("CHNAME::>" + _ch_name + " Remaining::> " + _t_playRemain); _rtn_epg["progress_pcent"] = parseInt(((_t_playTotal-_t_playRemain)*100)/_t_playTotal, 10); - _rtn_epg["playing_time"] = `${_epgProgInf_Prev.time}~${_epgProgInf_Cur.time}`; + _rtn_epg["playing_time"] = __str_playingTime; break; } }