def _get_series(self, series): """Search thetvdb.com for the series name. If a custom_ui UI is configured, it uses this to select the correct series. If not, and interactive == True, ConsoleUI is used, if not BaseUI is used to select the first result. :param series: the query for the series name :return: A list of series mapped to a UI (for example: a BaseUi or custom_ui). """ all_series = self.search(series) if not all_series: log.debug('Series result returned zero') IndexerShowNotFound( 'Show search returned zero results (cannot find show on TVDB)') if not isinstance(all_series, list): all_series = [all_series] if self.config['custom_ui'] is not None: log.debug('Using custom UI {0!r}', self.config['custom_ui']) custom_ui = self.config['custom_ui'] ui = custom_ui(config=self.config) else: if not self.config['interactive']: log.debug('Auto-selecting first search result using BaseUI') ui = BaseUI(config=self.config) else: log.debug('Interactively selecting show using ConsoleUI') ui = ConsoleUI(config=self.config) # pylint: disable=redefined-variable-type return ui.select_series(all_series)
def _get_series(self, series): """Search themoviedb.org for the series name. If a custom_ui UI is configured, it uses this to select the correct series. If not, and interactive == True, ConsoleUI is used, if not BaseUI is used to select the first result. :param series: the query for the series name :return: A list of series mapped to a UI (for example: a BaseUi or CustomUI). """ all_series = self.search(series) if not all_series: log.debug('Series result returned zero') IndexerShowNotFound('Show search returned zero results (cannot find show on Indexer)') if not isinstance(all_series, list): all_series = [all_series] if self.config['custom_ui'] is not None: log.debug('Using custom UI {0!r}', self.config['custom_ui']) custom_ui = self.config['custom_ui'] ui = custom_ui(config=self.config) else: if not self.config['interactive']: log.debug('Auto-selecting first search result using BaseUI') ui = BaseUI(config=self.config) else: log.debug('Interactively selecting show using ConsoleUI') ui = ConsoleUI(config=self.config) # pylint: disable=redefined-variable-type return ui.select_series(all_series)