issue #10 #11 #12 Fix EPG info time issue.

This commit is contained in:
paul kim
2024-09-05 19:25:01 +09:00
parent 91cd321a59
commit 123c9d794d

View File

@@ -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;
}
}