def get_user_path(path, root):
    """
    Gets the path used as the key in the database,
    e.g. "/2017/2017 08-19 Yosemite"
    :param path: path on the local disk where the photo or dir
        is located
    :param root: path on the local disk that is the root of all
        photos and dirs
    """
    user_path = path.lstrip(root)
    if not user_path.startswith('/'):
        user_path = "/{}".format(user_path)
    return user_path