def get_files_and_dirs_from_db(items):
    """
    Returns (files, directories) from a source with files and directories mixed.
    """
    files = []
    dirs = []
    for item in items:
        if "directory" in item:
            dirs.append(item["directory"])
        elif "file" in item:
            files.append(item["file"])

    return (files, dirs)