Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove find implementation #285

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
cache path->id
  • Loading branch information
skshetry committed Jun 20, 2023
commit f976876dd3a5673ddc8ca4fda8100a71b228ffa5
8 changes: 5 additions & 3 deletions pydrive2/fs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,14 @@ def ls(self, path, detail=False):
root_path = posixpath.join(bucket, base)
contents = []
for item in self._gdrive_list_ids(dir_ids):
item_path = posixpath.join(root_path, item["title"])
item_path = posixpath.join(base, item["title"])
full_path = posixpath.join(root_path, item["title"])
if item["mimeType"] == FOLDER_MIME_TYPE:
self._cache_path_id(item_path, item["id"])
contents.append(
{
"type": "directory",
"name": item_path.rstrip("/") + "/",
"name": full_path.rstrip("/") + "/",
"size": 0,
}
)
Expand All @@ -455,7 +457,7 @@ def ls(self, path, detail=False):
contents.append(
{
"type": "file",
"name": item_path,
"name": full_path,
"size": int(size) if size is not None else size,
"checksum": item.get("md5Checksum"),
}
Expand Down