def get_person_info(person_label):
    persons = person_label.split(' / ')
    response = get_tmdb_data(
        'search/person?query=%s&include_adult=%s&' % (Utils.url_quote(
            persons[0]), xbmcaddon.Addon().getSetting('include_adults')), 30)
    if not response or 'results' not in response:
        return False
    if len(response['results']) > 1:
        listitem, index = wm.open_selectdialog(
            listitems=handle_tmdb_people(response['results']))
        if index >= 0:
            return response['results'][index]
    elif response['results']:
        return response['results'][0]
    return False
Exemple #2
0
 def open_credit_dialog(self, credit_id):
     info = TheMovieDB.get_credit_info(credit_id)
     listitems = []
     if 'seasons' in info['media']:
         listitems += TheMovieDB.handle_tmdb_seasons(
             info['media']['seasons'])
     if 'episodes' in info['media']:
         listitems += TheMovieDB.handle_tmdb_episodes(
             info['media']['episodes'])
     if not listitems:
         listitems += [{'label': 'No information available'}]
     listitem, index = wm.open_selectdialog(listitems=listitems)
     if listitem['media_type'] == 'episode':
         wm.open_episode_info(prev_window=self,
                              season=listitems[index]['season'],
                              episode=listitems[index]['episode'],
                              tvshow_id=info['media']['id'])
     elif listitem['media_type'] == 'season':
         wm.open_season_info(prev_window=self,
                             season=listitems[index]['season'],
                             tvshow_id=info['media']['id'])