mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 13:38:38 +00:00
changes regarding td support
This commit is contained in:
@@ -47,6 +47,7 @@ export async function GET(request: NextRequest) {
|
||||
{
|
||||
fileId: path.passwordId as string,
|
||||
alt: "media",
|
||||
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
|
||||
},
|
||||
{ responseType: "text" },
|
||||
)
|
||||
|
||||
@@ -20,6 +20,7 @@ export async function GET(request: NextRequest, { params }: { params: { encrypte
|
||||
const fileContent = await gdrive.files.get({
|
||||
fileId: lastId,
|
||||
fields: "id, name, mimeType, parents",
|
||||
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
|
||||
});
|
||||
if (fileContent) {
|
||||
path.push(fileContent.data.name as string);
|
||||
@@ -29,6 +30,7 @@ export async function GET(request: NextRequest, { params }: { params: { encrypte
|
||||
const folderContent = await gdrive.files.get({
|
||||
fileId: lastId,
|
||||
fields: "id, name, mimeType, parents",
|
||||
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
|
||||
});
|
||||
if (folderContent.data.id === gIndexConfig.apiConfig.rootFolder) {
|
||||
lastId = "";
|
||||
|
||||
@@ -5,7 +5,6 @@ import getSearchParams from "utils/apiHelper/getSearchParams";
|
||||
import { encryptData } from "utils/encryptionHelper/hash";
|
||||
import ExtendedError from "utils/extendedError";
|
||||
import { gdriveFilesList } from "utils/gdrive";
|
||||
import gdrive from "utils/gdriveInstance";
|
||||
|
||||
import { IGDriveFiles } from "types/api/files";
|
||||
import { APISearchResponse, ErrorResponse } from "types/api/response";
|
||||
|
||||
@@ -39,7 +39,7 @@ const config: gIndexConfig = {
|
||||
* You need to create a new folder and share it with the service account
|
||||
* Then, copy the folder id and paste it here
|
||||
*/
|
||||
rootFolder: "",
|
||||
rootFolder: "1KgPV6QB1GYT8fmn2uTfbtr9rDXqcRR0j",
|
||||
isTeamDrive: false, // Set this to true if you're using Team Drive
|
||||
defaultQuery: ["trashed = false", "(not mimeType contains 'google-apps' or mimeType contains 'folder')"],
|
||||
defaultField:
|
||||
|
||||
@@ -197,7 +197,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
const fetchRootId = gdrive.files.get({
|
||||
fileId: gIndexConfig.apiConfig.rootFolder,
|
||||
fields: "id",
|
||||
supportsAllDrives: true,
|
||||
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
|
||||
});
|
||||
const fetchPathId = path.map(async (path) => {
|
||||
const query = ["trashed = false", `name = '${path}'`];
|
||||
|
||||
Reference in New Issue
Block a user