'Fetches an album by its Discogs ID and returns an AlbumInfo object
or None if the album is not found.'

def album_for_id(self, album_id):

    if (not self.discogs_client):
        return
    self._log.debug(u'Searching    for    release    {0}', album_id)
    match = re.search('(^|\\[*r|discogs\\.com/.+/release/)(\\d+)($|\\])', album_id)
    if (not match):
        return None
    result = Release(self.discogs_client, {'id': int(match.group(2))})
    try:
        getattr(result, 'title')
    except DiscogsAPIError as e:
        if (e.status_code != 404):
            self._log.debug(u'API    Error:    {0}    (query:    {1})', e, result._uri)
            if (e.status_code == 401):
                self.reset_auth()
                return self.album_for_id(album_id)
        return None
    except CONNECTION_ERRORS:
        self._log.debug(u'Connection    error    in    album    lookup', exc_info=True)
        return None
    return self.get_album_info(result)
