def _check_config(self, hosts=None, apikeys=None): from sickbeard.helpers import starify hosts, keys = self._choose(hosts, sickbeard.EMBY_HOST), self._choose( apikeys, sickbeard.EMBY_APIKEY) hosts = [x.strip() for x in hosts.split(',') if x.strip()] keys = [x.strip() for x in keys.split(',') if x.strip()] new_keys = [] has_old_key = False for key in keys: if starify(key, True): has_old_key = True else: new_keys += [key] apikeys = has_old_key and [ x.strip() for x in sickbeard.EMBY_APIKEY.split(',') if x.strip() ] or [] + new_keys if len(hosts) != len(apikeys): message = ('Not enough Api keys for hosts', 'More Api keys than hosts')[len(apikeys) > len(hosts)] self._log_warning(u'%s, check your settings' % message) return False, False, message return hosts, apikeys, 'OK'
def _check_config(self, hosts=None, apikeys=None): from sickbeard.helpers import starify hosts, keys = self._choose(hosts, sickbeard.EMBY_HOST), self._choose(apikeys, sickbeard.EMBY_APIKEY) hosts = [x.strip() for x in hosts.split(',') if x.strip()] keys = [x.strip() for x in keys.split(',') if x.strip()] new_keys = [] has_old_key = False for key in keys: if starify(key, True): has_old_key = True else: new_keys += [key] apikeys = has_old_key and [x.strip() for x in sickbeard.EMBY_APIKEY.split(',') if x.strip()] or [] + new_keys if len(hosts) != len(apikeys): message = ('Not enough Api keys for hosts', 'More Api keys than hosts')[len(apikeys) > len(hosts)] self._log_warning(u'%s, check your settings' % message) return False, False, message return hosts, apikeys, 'OK'