def prepare_lookup_for_tvmaze(**lookup_params):
 prepared_params = {}
 title = None
 series_name = (lookup_params.get(u'series_name') or lookup_params.get(u'show_name') or lookup_params.get(u'title'))
 if series_name:
  (title, _) = split_title_year(series_name)
 if (not title):
  title = series_name
 prepared_params[u'tvmaze_id'] = lookup_params.get(u'tvmaze_id')
 prepared_params[u'thetvdb_id'] = (lookup_params.get(u'tvdb_id') or lookup_params.get(u'trakt_series_tvdb_id'))
 prepared_params[u'tvrage_id'] = (lookup_params.get(u'tvrage_id') or lookup_params.get(u'trakt_series_tvrage_id'))
 prepared_params[u'imdb_id'] = lookup_params.get(u'imdb_id')
 prepared_params[u'show_name'] = (native(title) if title else None)
 return prepared_params

def prepare_lookup_for_tvmaze ( ** lookup_params ) : prepared_params = { } title = None series_name = ( lookup_params . get ( u'series_name' ) or lookup_params . get ( u'show_name' ) or lookup_params . get ( u'title' ) ) if series_name : ( title , _ ) = split_title_year ( series_name ) if ( not title ) : title = series_name prepared_params [ u'tvmaze_id' ] = lookup_params . get ( u'tvmaze_id' ) prepared_params [ u'thetvdb_id' ] = ( lookup_params . get ( u'tvdb_id' ) or lookup_params . get ( u'trakt_series_tvdb_id' ) ) prepared_params [ u'tvrage_id' ] = ( lookup_params . get ( u'tvrage_id' ) or lookup_params . get ( u'trakt_series_tvrage_id' ) ) prepared_params [ u'imdb_id' ] = lookup_params . get ( u'imdb_id' ) prepared_params [ u'show_name' ] = ( native ( title ) if title else None ) return prepared_params
return a dict of params which is valid with tvmaze api lookups .