parameters: (list_item, show_info, full_info=True)
return_statement: return list_item
docstring: Add main show info to a list item
docstring_summary: Add main show info to a list item
docstring_tokens: Add main show info to a list item
function: def add_main_show_info(list_item, show_info, full_info=True):
      # type: (ListItem, InfoType, bool) -> ListItem
      """Add main show info to a list item"""
      plot = _clean_plot(safe_get(show_info, 'overview', ''))
      original_name = show_info.get('original_name')
      if settings.KEEPTITLE and original_name:
          showname = original_name
      else:
          showname = show_info['name']
      video = {
          'plot': plot,
          'plotoutline': plot,
          'title': showname,
          'originaltitle': original_name,
          'tvshowtitle': showname,
          'mediatype': 'tvshow',
          # This property is passed as "url" parameter to getepisodelist call
          'episodeguide': str(show_info['id']),
      }
      if show_info.get('first_air_date'):
          video['year'] = int(show_info['first_air_date'][:4])
          video['premiered'] = show_info['first_air_date']
      if full_info:
          video['status'] = safe_get(show_info, 'status', '')
          genre_list = safe_get(show_info, 'genres', {})
          genres = []
          for genre in genre_list:
              genres.append(genre['name'])
          video['genre'] = genres
          networks = show_info.get('networks', [])
          if networks:
              network = networks[0]
              country = network.get('origin_country', '')
          else:
              network = None
              country = None
          if network and country:
              video['studio'] = '{0} ({1})'.format(network['name'], country)
              video['country'] = country
          content_ratings = show_info.get('content_ratings', {}).get('results', {})
          if content_ratings:
              mpaa = ''
              mpaa_backup = ''
              for content_rating in content_ratings:
                  iso = content_rating.get('iso_3166_1', '').lower()
                  if iso == 'us':
                      mpaa_backup = content_rating.get('rating')
                  if iso == settings.CERT_COUNTRY.lower():
                      mpaa = content_rating.get('rating', '')
              if not mpaa:
                  mpaa = mpaa_backup
              if mpaa:
                  video['Mpaa'] = settings.CERT_PREFIX + mpaa
          video['credits'] = video['writer'] = _get_credits(show_info)
          list_item = set_show_artwork(show_info, list_item)
          list_item = _add_season_info(show_info, list_item)
          list_item = _set_cast(show_info['credits']['cast'], list_item)
          list_item = _set_rating(show_info, list_item)
          ext_ids = {'tmdb_id': show_info['id']}
          ext_ids.update(show_info.get('external_ids', {}))
          list_item =  _set_unique_ids(ext_ids, list_item)
      else:
          image = safe_get(show_info, 'poster_path', '')
          if image:
              theurl = settings.IMAGEROOTURL + image
              previewurl = settings.PREVIEWROOTURL + image
              list_item.addAvailableArtwork(theurl, art_type='poster', preview=previewurl)
      logger.debug('adding tv show information for %s to list item' % video['tvshowtitle'])
      list_item.setInfo('video', video)
      # This is needed for getting artwork
      list_item = _set_unique_ids(show_info, list_item)
      return list_item
function_tokens: def add_main_show_info ( list_item , show_info , full_info = True ) : # type: (ListItem, InfoType, bool) -> ListItem plot = _clean_plot ( safe_get ( show_info , 'overview' , '' ) ) original_name = show_info . get ( 'original_name' ) if settings . KEEPTITLE and original_name : showname = original_name else : showname = show_info [ 'name' ] video = { 'plot' : plot , 'plotoutline' : plot , 'title' : showname , 'originaltitle' : original_name , 'tvshowtitle' : showname , 'mediatype' : 'tvshow' , # This property is passed as "url" parameter to getepisodelist call 'episodeguide' : str ( show_info [ 'id' ] ) , } if show_info . get ( 'first_air_date' ) : video [ 'year' ] = int ( show_info [ 'first_air_date' ] [ : 4 ] ) video [ 'premiered' ] = show_info [ 'first_air_date' ] if full_info : video [ 'status' ] = safe_get ( show_info , 'status' , '' ) genre_list = safe_get ( show_info , 'genres' , { } ) genres = [ ] for genre in genre_list : genres . append ( genre [ 'name' ] ) video [ 'genre' ] = genres networks = show_info . get ( 'networks' , [ ] ) if networks : network = networks [ 0 ] country = network . get ( 'origin_country' , '' ) else : network = None country = None if network and country : video [ 'studio' ] = '{0} ({1})' . format ( network [ 'name' ] , country ) video [ 'country' ] = country content_ratings = show_info . get ( 'content_ratings' , { } ) . get ( 'results' , { } ) if content_ratings : mpaa = '' mpaa_backup = '' for content_rating in content_ratings : iso = content_rating . get ( 'iso_3166_1' , '' ) . lower ( ) if iso == 'us' : mpaa_backup = content_rating . get ( 'rating' ) if iso == settings . CERT_COUNTRY . lower ( ) : mpaa = content_rating . get ( 'rating' , '' ) if not mpaa : mpaa = mpaa_backup if mpaa : video [ 'Mpaa' ] = settings . CERT_PREFIX + mpaa video [ 'credits' ] = video [ 'writer' ] = _get_credits ( show_info ) list_item = set_show_artwork ( show_info , list_item ) list_item = _add_season_info ( show_info , list_item ) list_item = _set_cast ( show_info [ 'credits' ] [ 'cast' ] , list_item ) list_item = _set_rating ( show_info , list_item ) ext_ids = { 'tmdb_id' : show_info [ 'id' ] } ext_ids . update ( show_info . get ( 'external_ids' , { } ) ) list_item = _set_unique_ids ( ext_ids , list_item ) else : image = safe_get ( show_info , 'poster_path' , '' ) if image : theurl = settings . IMAGEROOTURL + image previewurl = settings . PREVIEWROOTURL + image list_item . addAvailableArtwork ( theurl , art_type = 'poster' , preview = previewurl ) logger . debug ( 'adding tv show information for %s to list item' % video [ 'tvshowtitle' ] ) list_item . setInfo ( 'video' , video ) # This is needed for getting artwork list_item = _set_unique_ids ( show_info , list_item ) return list_item