Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 341354c

Browse files
authored
Merge pull request #410 from skaut/shortcuts
Added support for Drive shortcuts
2 parents 1403ccc + beed444 commit 341354c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/backend/listFolders.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ function listFolders(parentID: string): Array<NamedRecord> {
99
q:
1010
'"' +
1111
parentID +
12-
'" in parents and mimeType = "application/vnd.google-apps.folder" and trashed = false',
12+
'" in parents and (mimeType = "application/vnd.google-apps.folder" or (mimeType = "application/vnd.google-apps.shortcut" and shortcutDetails.targetMimeType = "application/vnd.google-apps.folder")) and trashed = false',
1313
supportsAllDrives: true,
1414
pageToken: pageToken,
1515
maxResults: 1000,
16-
fields: "nextPageToken, items(id, title)",
16+
fields:
17+
"nextPageToken, items(id, title, mimeType, shortcutDetails(targetId))",
1718
});
1819
for (const item of response.items!) {
19-
ret.push({ id: item.id!, name: item.title! });
20+
const id =
21+
item.mimeType === "application/vnd.google-apps.shortcut"
22+
? item.shortcutDetails!.targetId!
23+
: item.id!;
24+
ret.push({ id, name: item.title! });
2025
}
2126
pageToken = response.nextPageToken;
2227
} while (pageToken !== undefined);

0 commit comments

Comments
 (0)