def lookup(self, entry, search_allowed=True): """ Perform Rotten Tomatoes lookup for entry. :param entry: Entry instance :param search_allowed: Allow fallback to search :raises PluginError: Failure reason """ imdb_id = entry.get('imdb_id', eval_lazy=False) or \ imdb.extract_id(entry.get('imdb_url', eval_lazy=False)) if imdb_id: movie = lookup_movie(title=entry.get('imdb_name'), year=entry.get('imdb_year'), rottentomatoes_id=entry.get('rt_id', eval_lazy=False), imdb_id=imdb_id, only_cached=(not search_allowed)) else: movie = lookup_movie(smart_match=entry['title'], rottentomatoes_id=entry.get('rt_id', eval_lazy=False), only_cached=(not search_allowed)) log.debug(u'Got movie: %s' % movie) entry.update_using_map(self.field_map, movie)
def lookup(self, entry, search_allowed=True, key=None): """ Perform Rotten Tomatoes lookup for entry. :param entry: Entry instance :param search_allowed: Allow fallback to search :param key: optionally specify an API key to use :raises PluginError: Failure reason """ if not key: key = API_KEY movie = lookup_movie(smart_match=entry['title'], rottentomatoes_id=entry.get('rt_id', eval_lazy=False), only_cached=(not search_allowed), api_key=key ) log.debug(u'Got movie: %s' % movie) entry.update_using_map(self.field_map, movie)
def lookup(self, entry, search_allowed=True, key=None): """ Perform Rotten Tomatoes lookup for entry. :param entry: Entry instance :param search_allowed: Allow fallback to search :param key: optionally specify an API key to use :raises PluginError: Failure reason """ if not key: key = API_KEY movie = lookup_movie(smart_match=entry['title'], rottentomatoes_id=entry.get('rt_id', eval_lazy=False), only_cached=(not search_allowed), api_key=key) log.debug(u'Got movie: %s' % movie) entry.update_using_map(self.field_map, movie)