from pathlib import Path
from typing import List


def get_acqui_id(mpath: Path, cam_folders: List[str], sync_folder: str) -> List[str]:
    """
    Return the names of all acqusition ids within sync_dir across
    both camera's

    Parameters
    ----------
    mpath : Path
        The parent micasense data directory that contains the cam_folders
    cam_folders : List[str]
        A list of the camera folder names, e.g. ["red_cam", "blue_cam"]
    sync_folder : str
        The name of the "SYNCXXXXSET" folder
    Returns
    -------
    acqi_ids : List[str]
        List of acquisition id's, e.g.
        ["0000", "0001", "0002", ....., "XXXX"]
    """
    acqi_ids = []
    for cam in cam_folders:
        # cam = "red_cam" or "blue_cam"
        for f in (mpath / cam / sync_folder).glob("**/*.tif"):
            acqi_ids.append(f.stem.split("_")[1])

    return sorted(list(set(acqi_ids)))