def last_added_num(path):
    """
    Returns last added frame number for a `path` directory.
    `path` is a pathlib.Path object.  

    Return 0 if no files in directory.
    """
    files = list(path.iterdir())
    if not files:
        return 0
    
    # Get all frame numbers.
    numbers = [int(str(file.name).split('.')[0]) for file in files]

    return max(numbers)