def getEpisode(self, name, begin, end=None, service=None):
        # On Success: Return a single season, episode, title tuple
        # On Failure: Return a empty list or String or None

        # Check preconditions
        if not name:
            msg = _("Skipping lookup because no show name is specified")
            log.warning(msg)
            return msg
        if not begin:
            msg = _("Skipping lookup because no begin timestamp is specified")
            log.warning(msg)
            return msg
        if not service:
            msg = _("Skipping lookup because no channel is specified")
            log.warning(msg)
            return msg

        self.name = name
        self.begin = begin
        self.end = end
        self.service = service

        log.info("SerienServer getEpisode, name, begin, end=None, service",
                 name, begin, end, service)

        # Prepare parameters
        webChannels = lookupChannelByReference(service)
        if not webChannels:
            msg = _("No matching channel found.") + "\n" + getChannel(
                service
            ) + " (" + str(service) + ")\n\n" + _(
                "Please open the Channel Editor and add the channel manually.")
            log.warning(msg)
            return msg

        unixtime = str(begin)
        max_time_drift = self.max_time_drift

        # Lookup
        for webChannel in webChannels:
            log.debug(
                "SerienServer getSeasonEpisode(): [\"%s\",\"%s\",\"%s\",%s]" %
                (name, webChannel, unixtime, max_time_drift))

            result = self.server.getSeasonEpisode(name, webChannel, unixtime,
                                                  self.max_time_drift)

            if result and isinstance(result, dict):
                result['service'] = service
                result['channel'] = webChannel
                result['begin'] = begin

            log.debug("SerienServer getSeasonEpisode result:", type(result),
                      result)

            return result

        else:
            return (_("No match found"))
Exemple #2
0
    def getEpisode(self, name, begin, end=None, service=None):
        # On Success: Return a single season, episode, title tuple
        # On Failure: Return a empty list or String or None

        # Check preconditions
        if not name:
            msg = _("Skip: No show name specified")
            logInfo(msg)
            return msg
        if not begin:
            msg = _("Skip: No begin timestamp specified")
            logInfo(msg)
            return msg
        if not service:
            msg = _("Skip: No service specified")
            logInfo(msg)
            return msg

        self.name = name
        self.begin = begin
        self.end = end
        self.service = service

        logInfo("SerienServer getEpisode, name, begin, end=None, service",
                name, begin, end, service)

        # Prepare parameters
        webChannels = lookupChannelByReference(service)
        if not webChannels:
            msg = _("Check the channel name")
            logInfo(msg)
            return msg

        unixtime = str(begin)
        max_time_drift = self.max_time_drift

        # Lookup
        for webChannel in webChannels:
            logDebug(
                "SerienServer getSeasonEpisode(): [\"%s\",\"%s\",\"%s\",%s]" %
                (name, webChannel, unixtime, max_time_drift))

            result = self.server.getSeasonEpisode(name, webChannel, unixtime,
                                                  self.max_time_drift)

            if result and isinstance(result, dict):
                result['service'] = service
                result['channel'] = webChannel

            logDebug("SerienServer getSeasonEpisode result:", type(result),
                     result)

            return result

        else:
            return (_("No match found"))
	def getEpisode(self, name, begin, end=None, service=None):
		# On Success: Return a single season, episode, title tuple
		# On Failure: Return a empty list or String or None
		
		
		# Check preconditions
		if not name:
			msg =_("Skipping lookup because no show name is specified")
			log.warning(msg)
			return msg
		if not begin:
			msg = _("Skipping lookup because no begin timestamp is specified")
			log.warning(msg)
			return msg
		if not service:
			msg = _("Skipping lookup because no channel is specified")
			log.warning(msg)
			return msg
		
		
		self.name = name
		self.begin = begin
		self.end = end
		self.service = service
		
		log.info("SerienServer getEpisode, name, begin, end=None, service", name, begin, end, service)
		
		# Prepare parameters
		webChannels = lookupChannelByReference(service)
		if not webChannels:
			msg = _("No matching channel found.") + "\n" + getChannel(service) + " (" + str(service) + ")\n\n" + _("Please open the Channel Editor and add the channel manually.")
			log.warning(msg)
			return msg
		
		unixtime = str(begin)
		max_time_drift = self.max_time_drift
		
		# Lookup
		for webChannel in webChannels:
			log.debug("SerienServer getSeasonEpisode(): [\"%s\",\"%s\",\"%s\",%s]" % (name, webChannel, unixtime, max_time_drift))
			
			result = self.server.getSeasonEpisode( name, webChannel, unixtime, self.max_time_drift )
			
			if result and isinstance(result, dict):
				result['service'] = service
				result['channel'] = webChannel
				result['begin'] = begin
			
			log.debug("SerienServer getSeasonEpisode result:", type(result), result)
			
			return result

		else:
			return ( _("No match found") )
	def getEpisode(self, name, begin, end=None, service=None):
		# On Success: Return a single season, episode, title tuple
		# On Failure: Return a empty list or String or None
		
		
		# Check preconditions
		if not name:
			msg =_("Skip: No show name specified")
			logInfo(msg)
			return msg
		if not begin:
			msg = _("Skip: No begin timestamp specified")
			logInfo(msg)
			return msg
		if not service:
			msg = _("Skip: No service / channel specified")
			logInfo(msg)
			return msg
		
		logInfo("SerienServer getEpisode, name, begin, end=None, service", name, begin, end, service)
		
		# Prepare parameters
		webChannels = lookupChannelByReference(service)
		if not webChannels:
			msg = _("No matching channel found.") + "\n\n" + _("Please open the Channel Editor and add the channel manually.")
			logInfo(msg)
			AddPopup(
				msg,
				MessageBox.TYPE_ERROR,
				-1,
				'SP_PopUp_ID_Error'
			)
			return msg
		
		unixtime = str(begin)
		max_time_drift = self.max_time_drift
		
		# Lookup
		for webChannel in webChannels:
			logDebug("SerienServer getSeasonEpisode(): [\"%s\",\"%s\",\"%s\",%s]" % (name, webChannel, unixtime, max_time_drift))
			
			result = self.server.getSeasonEpisode( name, webChannel, unixtime, self.max_time_drift )
			
			if result and isinstance(result, dict):
				result['service'] = service
				result['channel'] = webChannel
				result['begin'] = begin
			
			logDebug("SerienServer getSeasonEpisode result:", type(result), result)
			
			return result

		else:
			return ( _("No match found") )
	def getEpisode(self, name, begin, end=None, service=None):
		# On Success: Return a single season, episode, title tuple
		# On Failure: Return a empty list or String or None
		
		
		# Check preconditions
		if not name:
			msg =_("Skip: No show name specified")
			logInfo(msg)
			return msg
		if not begin:
			msg = _("Skip: No begin timestamp specified")
			logInfo(msg)
			return msg
		if not service:
			msg = _("Skip: No service specified")
			logInfo(msg)
			return msg
		
		
		self.name = name
		self.begin = begin
		self.end = end
		self.service = service
		
		logInfo("SerienServer getEpisode, name, begin, end=None, service", name, begin, end, service)
		
		# Prepare parameters
		webChannels = lookupChannelByReference(service)
		if not webChannels:
			msg = _("Check the channel name")
			logInfo(msg)
			return msg
		
		unixtime = str(begin)
		max_time_drift = self.max_time_drift
		
		# Lookup
		for webChannel in webChannels:
			logDebug("SerienServer getSeasonEpisode(): [\"%s\",\"%s\",\"%s\",%s]" % (name, webChannel, unixtime, max_time_drift))
			
			result = self.server.getSeasonEpisode( name, webChannel, unixtime, self.max_time_drift )
			
			if result and isinstance(result, dict):
				result['service'] = service
				result['channel'] = webChannel
			
			logDebug("SerienServer getSeasonEpisode result:", type(result), result)
			
			return result

		else:
			return ( _("No match found") )