def parse_metadata(metadata_list):
    """Parse the metadata from a set of strings to a dictionary"""
    if not metadata_list:
        return {}
    metadata = {}
    # Loop through the list of metadata values
    for pair in metadata_list:
        # Split the key part from the value
        key_path, value = pair.split("=", 1)
        # Split the key up if it is a dotted path
        keys = key_path.split(".")
        current_data = metadata
        # Loop through all but the last key and create the dictionary structure
        for key in keys[:-1]:
            if key not in current_data:
                current_data[key] = {}
            current_data = current_data[key]
        # Finally, set the actual value
        key = keys[-1]
        # Properly process list types
        if "," in value:
            value = value.split(",")
        current_data[key] = value
    return metadata