code: def analyze_lib(lib_dir, cover_filename, *, ignore_existing=False):
    
    work = {}
    stats = collections.OrderedDict(((k, 0) for k in("files", "albums", "missing covers", "errors")))
    with tqdm.tqdm(desc="Analyzing library",
                   unit="dir",
                   postfix=stats) as progress, \
            tqdm_logging.redirect_logging(progress):
      for rootpath, rel_dirpaths, rel_filepaths in os.walk(lib_dir):
        metadata = analyze_dir(stats,
                               rootpath,
                               rel_filepaths,
                               cover_filename,
                               ignore_existing=ignore_existing)
        progress.set_postfix(stats, refresh=False)
        progress.update(1)
        if all(metadata[:-1]):
          work[rootpath] = metadata[:-1]
    return work
docs: Recursively analyze library, and return a dict of path -> (artist, album).