def _add_candidate(items, results, info):
 log.debug(u'Candidate: {0} - {1}'.format(info.artist, info.album))
 if (not info.tracks):
  log.debug('No tracks.')
  return
 if (info.album_id in results):
  log.debug(u'Duplicate.')
  return
 for req_tag in config['match']['required'].as_str_seq():
  if (getattr(info, req_tag) is None):
   log.debug(u'Ignored. Missing required tag: {0}'.format(req_tag))
   return
 (mapping, extra_items, extra_tracks) = assign_items(items, info.tracks)
 dist = distance(items, info, mapping)
 penalties = [key for (_, key) in dist]
 for penalty in config['match']['ignored'].as_str_seq():
  if (penalty in penalties):
   log.debug(u'Ignored. Penalty: {0}'.format(penalty))
   return
 log.debug(u'Success. Distance: {0}'.format(dist))
 results[info.album_id] = hooks.AlbumMatch(dist, info, mapping, extra_items, extra_tracks)

def _add_candidate ( items , results , info ) : log . debug ( u'Candidate: {0} - {1}' . format ( info . artist , info . album ) ) if ( not info . tracks ) : log . debug ( 'No tracks.' ) return if ( info . album_id in results ) : log . debug ( u'Duplicate.' ) return for req_tag in config [ 'match' ] [ 'required' ] . as_str_seq ( ) : if ( getattr ( info , req_tag ) is None ) : log . debug ( u'Ignored. Missing required tag: {0}' . format ( req_tag ) ) return ( mapping , extra_items , extra_tracks ) = assign_items ( items , info . tracks ) dist = distance ( items , info , mapping ) penalties = [ key for ( _ , key ) in dist ] for penalty in config [ 'match' ] [ 'ignored' ] . as_str_seq ( ) : if ( penalty in penalties ) : log . debug ( u'Ignored. Penalty: {0}' . format ( penalty ) ) return log . debug ( u'Success. Distance: {0}' . format ( dist ) ) results [ info . album_id ] = hooks . AlbumMatch ( dist , info , mapping , extra_items , extra_tracks )
given a candidate albuminfo object .