def match_album(artist, album, tracks=None, limit=SEARCH_LIMIT):
 criteria = {'release': album.lower().strip()}
 if (artist is not None):
  criteria['artist'] = artist.lower().strip()
 else:
  criteria['arid'] = VARIOUS_ARTISTS_ID
 if (tracks is not None):
  criteria['tracks'] = str(tracks)
 if (not any(criteria.itervalues())):
  return
 try:
  res = musicbrainzngs.search_releases(limit=limit, **criteria)
 except musicbrainzngs.MusicBrainzError as exc:
  raise MusicBrainzAPIError(exc, 'release search', criteria, traceback.format_exc())
 for release in res['release-list']:
  albuminfo = album_for_id(release['id'])
  if (albuminfo is not None):
   (yield albuminfo)

def match_album ( artist , album , tracks = None , limit = SEARCH_LIMIT ) : criteria = { 'release' : album . lower ( ) . strip ( ) } if ( artist is not None ) : criteria [ 'artist' ] = artist . lower ( ) . strip ( ) else : criteria [ 'arid' ] = VARIOUS_ARTISTS_ID if ( tracks is not None ) : criteria [ 'tracks' ] = str ( tracks ) if ( not any ( criteria . itervalues ( ) ) ) : return try : res = musicbrainzngs . search_releases ( limit = limit , ** criteria ) except musicbrainzngs . MusicBrainzError as exc : raise MusicBrainzAPIError ( exc , 'release search' , criteria , traceback . format_exc ( ) ) for release in res [ 'release-list' ] : albuminfo = album_for_id ( release [ 'id' ] ) if ( albuminfo is not None ) : ( yield albuminfo )
searches for a single album and returns an iterator over albuminfo objects .