def _getSeries(self, series): """This searches 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. """ allSeries = [] try: allSeries += self.search(series) if not allSeries: raise tvdb_shownotfound except tvdb_shownotfound: # search via imdbId for x in imdbpie.Imdb().search_for_title(series): if x['title'].lower() == series.lower(): allSeries += self.search(imdbid=x['imdb_id']) if not allSeries: sickrage.srCore.srLogger.debug('Series result returned zero') raise tvdb_shownotfound( "Show search returned zero results (cannot find show on theTVDB)" ) ui = BaseUI(config=self.config) if self.config['custom_ui'] is not None: CustomUI = self.config['custom_ui'] ui = CustomUI(config=self.config) return ui.selectSeries(allSeries, series)
def _getSeries(self, series): """This searches 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. """ allSeries = [] try: allSeries += self.search(series) if not allSeries: raise tvdb_shownotfound except tvdb_shownotfound: # search via imdbId for x in imdbpie.Imdb().search_for_title(series): if x['title'].lower() == series.lower(): allSeries += self.search(imdbid=x['imdb_id']) if not allSeries: sickrage.srCore.srLogger.debug('Series result returned zero') raise tvdb_shownotfound("Show search returned zero results (cannot find show on theTVDB)") ui = BaseUI(config=self.config) if self.config['custom_ui'] is not None: CustomUI = self.config['custom_ui'] ui = CustomUI(config=self.config) return ui.selectSeries(allSeries, series)