def METHOD_NAME(gallery):
    """Restores the metadata cache from the cache file"""
    cachePath = os.path.join(gallery.settings["destination"], ".metadata_cache")
    try:
        if os.path.exists(cachePath):
            with open(cachePath, "rb") as cacheFile:
                gallery.metadataCache = pickle.load(cacheFile)
                logger.debug("Loaded cache with %d entries", len(gallery.metadataCache))
        else:
            gallery.metadataCache = {}
    except Exception as e:
        logger.warning("Could not load cache: %s", e)
        gallery.metadataCache = {}