Esempio n. 1
0
def thread_zap_wait_timer(_self, selectMode, clickOnSelection):
    while var.thread_zap_wait_timer != None and var.addonmonitor.abortRequested(
    ) == False and func.check_addon_running() == True:
        xbmc.sleep(100)
        interactSecond = 3
        lastInteractSeconds = int(
            (datetime.now() - var.ZapDelayDateTime).total_seconds())
        if var.ZapTimerForce or lastInteractSeconds >= interactSecond or len(
                var.ZapNumberString) == 4:
            #Handle remote action
            if selectMode:
                select_remote_number(_self, clickOnSelection)
            else:
                zap_remote_number(_self)

            #Hide remote number popup
            _self.setProperty('ZapVisible', 'false')
            func.updateLabelText(_self, 7001, '')

            #Reset remote variables
            var.ZapControlId = 0
            var.ZapNumberString = ''
            var.ZapHintString = ''
            var.ZapTimerForce = False
            var.thread_zap_wait_timer = None
        else:
            #Countdown string
            zapCountInt = interactSecond - lastInteractSeconds
            zapCountDownString = '[COLOR gray]' + str(
                zapCountInt) + '[/COLOR] ' + var.ZapHintString

            #Show remote number popup
            func.updateLabelText(_self, 7001, zapCountDownString)
            _self.setProperty('ZapVisible', 'true')
Esempio n. 2
0
    def thread_channel_delay_timer(self):
        while var.thread_channel_delay_timer != None and var.addonmonitor.abortRequested(
        ) == False and func.check_addon_running() == True:
            xbmc.sleep(100)
            interactSecond = 3
            lastInteractSeconds = int(
                (datetime.now() - var.ChannelDelayDateTime).total_seconds())

            #Channel information
            listcontainer = self.getControl(1001)
            listItemSelected = listcontainer.getSelectedItem()
            channelNameProp = listItemSelected.getProperty("ChannelName")
            channelNumberProp = listItemSelected.getProperty("ChannelNumber")

            #Countdown string
            delayCountInt = interactSecond - lastInteractSeconds
            delayCountString = '[COLOR gray]' + str(
                delayCountInt
            ) + '[/COLOR] ' + func.get_provider_color_string(
            ) + channelNumberProp + '[/COLOR] [COLOR white]' + channelNameProp + '[/COLOR]'

            #Show remaining time
            func.updateLabelText(self, 7001, delayCountString)
            self.setProperty('ZapVisible', 'true')

            #Change the channel
            if lastInteractSeconds >= interactSecond:
                #Reset channel wait variables
                var.thread_channel_delay_timer = None
                self.setProperty('ZapVisible', 'false')

                #Switch to selected channel
                stream.switch_channel_tv_listitem(listItemSelected, False,
                                                  False)
Esempio n. 3
0
 def thread_update_playergui_info(self):
     while var.thread_update_playergui_info != None and var.addonmonitor.abortRequested(
     ) == False and func.check_addon_running() == True:
         playerSeek = xbmc.getCondVisibility('Control.IsVisible(5000)')
         if playerSeek:
             self.update_epg_information()
         xbmc.sleep(200)
Esempio n. 4
0
def thread_login_auto():
    while var.thread_login_auto != None and var.addonmonitor.abortRequested(
    ) == False and func.check_addon_running() == True:
        #Check if it is time to auto login
        LastLoginSeconds = int(
            (datetime.now() - var.ApiLastLogin).total_seconds())
        if LastLoginSeconds >= 890:
            if var.ApiLoggedIn == True:
                ApiLogin(False)
        else:
            xbmc.sleep(5000)
Esempio n. 5
0
 def thread_hide_playergui_info(self):
     while var.thread_hide_playergui_info != None and var.addonmonitor.abortRequested(
     ) == False and func.check_addon_running() == True:
         lastInteractSeconds = int(
             (datetime.now() -
              self.PlayerInfoLastInteraction).total_seconds())
         if lastInteractSeconds >= int(
                 var.addon.getSetting('PlayerInformationCloseTime')):
             self.hide_epg()
         else:
             xbmc.sleep(1000)
Esempio n. 6
0
 def thread_update_epg_progress(self):
     threadLastTime = (datetime.now() -
                       timedelta(minutes=1)).strftime('%H:%M')
     while var.thread_update_epg_progress != None and var.addonmonitor.abortRequested(
     ) == False and func.check_addon_running() == True:
         threadCurrentTime = datetime.now().strftime('%H:%M')
         if threadLastTime != threadCurrentTime:
             threadLastTime = threadCurrentTime
             self.load_epg()
         else:
             xbmc.sleep(1000)
Esempio n. 7
0
def thread_sleep_timer():
    threadLastTime = (datetime.now() - timedelta(minutes=1)).strftime('%H:%M')
    while var.thread_sleep_timer != None and var.addonmonitor.abortRequested(
    ) == False and func.check_addon_running() == True:
        threadCurrentTime = datetime.now().strftime('%H:%M')
        if threadLastTime != threadCurrentTime:
            threadLastTime = threadCurrentTime
            var.SleepEndingMinutes -= 1
            sleep_notification()
        else:
            xbmc.sleep(1000)