def _onMessageNote(self, message):
     if not self.executeKodiCmd(message):
         # Show instantly if enabled
         if getSetting('handling_note',0) == 0 and pushhandler.canHandle(message):
             pushhandler.handlePush(message)
         # else show notification if enabled
         elif getSetting('handling_note',0) == 1:
             self.showNotificationFromMessage(message)
 def _onMessageList(self, message):
     # Show instantly if enabled
     if common.getSetting('handling_list',0) == 0 and pushhandler.canHandle(message):
         pushhandler.handlePush(message)
     elif common.getSetting('handling_list',0) == 1:
         self.showNotificationFromMessage(message)
     else:
         return False
     return True
Esempio n. 3
0
 def _onMessageAddress(self, message):
     # Show instantly if enabled
     if common.getSetting('handling_address',
                          0) == 0 and pushhandler.canHandle(message):
         pushhandler.handlePush(message)
     elif common.getSetting('handling_address', 0) == 1:
         self.showNotificationFromMessage(message)
     else:
         return False
     return True
    def handleMediaPush(self, media_type, message):
        # Check if instant play is enabled for the media type and play
        if not media_type in ('video','audio','image'): return False
        if getSetting('handling_{0}'.format(media_type),0) == 0:
            pushhandler.handlePush(message)
            return True
        elif getSetting('handling_{0}'.format(media_type),0) == 1:
            self.showNotificationFromMessage(message)

        return False
Esempio n. 5
0
 def _onMessageNote(self, message):
     if not self.executeKodiCmd(message):
         # Show instantly if enabled
         if common.getSetting('handling_note',
                              0) == 0 and pushhandler.canHandle(message):
             pushhandler.handlePush(message)
         # else show notification if enabled
         elif common.getSetting('handling_note', 0) == 1:
             self.showNotificationFromMessage(message)
         else:
             return False
     return True
    def handleMediaPush(self, media_type, message):
        # Check if instant play is enabled for the media type and play
        if media_type in ('video','audio','image'):
            if common.getSetting('handling_{0}'.format(media_type),0) == 0:
                if not pushhandler.mediaPlaying() or common.getSetting('interrupt_media',False):
                    pushhandler.handlePush(message)
                    return True

        if common.getSetting('handling_{0}'.format(media_type),0) == 1:
            self.showNotificationFromMessage(message)
            return True
        return False
Esempio n. 7
0
    def handleMediaPush(self, media_type, message):
        # Check if instant play is enabled for the media type and play
        if media_type in ('video', 'audio', 'image'):
            if common.getSetting('handling_{0}'.format(media_type), 0) == 0:
                if not pushhandler.mediaPlaying() or common.getSetting(
                        'interrupt_media', False):
                    pushhandler.handlePush(message)
                    return True

        if common.getSetting('handling_{0}'.format(media_type), 0) == 1:
            self.showNotificationFromMessage(message)
            return True
        return False
Esempio n. 8
0
    def runServer(self):
        while self.targetsBox.ready() and not xbmc.abortRequested:
            self.targetsBox.join()
            if self.targetsBox.device.hasPush():
                if self.instantPlay:
                    if not StreamUtils.isPlaying() or self.interruptMedia:
                        data = self.targetsBox.device.getNext()
                        if data: pushhandler.handlePush(data)
                else:
                    if self.showNotification:
                        data = self.targetsBox.device.getNext()
                        if data:
                            util.notify(
                                '{0}: {1}'.format(util.T(32090),
                                                  data.get('type', '?')),
                                data.get('title', ''))
                    self.targetsBox.device.clear()

            xbmc.sleep(200)

        self.targetsBox.close()
        self.targetsBox = None
Esempio n. 9
0
	def runServer(self):
		while self.targetsBox.ready() and not xbmc.abortRequested:
			self.targetsBox.join()
			if self.targetsBox.device.hasPush():
				if self.instantPlay:
					if not StreamUtils.isPlaying() or self.interruptMedia:
						data = self.targetsBox.device.getNext()
						if data: pushhandler.handlePush(data)
				else:
					if self.showNotification:
						data = self.targetsBox.device.getNext()
						if data:
							util.notify(
								'{0}: {1}'.format(util.T(32090),data.get('type','?')),
								data.get('title','')
							)
					self.targetsBox.device.clear()

			xbmc.sleep(200)
		
		self.targetsBox.close()
		self.targetsBox = None
 def _onMessageAddress(self, message):
     # Show instantly if enabled
     if getSetting('handling_address',0) == 0 and pushhandler.canHandle(message):
         pushhandler.handlePush(message)
     elif getSetting('handling_address',0) == 1:
         self.showNotificationFromMessage(message)