From 0cefafa49126af5a65812c1f30c928bb5266dc3a Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Fri, 24 May 2024 22:03:44 +0800 Subject: [PATCH] special treatment for jianguoyun --- src/fsWebdav.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/fsWebdav.ts b/src/fsWebdav.ts index 70cddd9..0b1f6e5 100644 --- a/src/fsWebdav.ts +++ b/src/fsWebdav.ts @@ -422,7 +422,20 @@ export class FakeFsWebdav extends FakeFs { // glob: "/**" /* avoid dot files by using glob */, }) as Promise; }); - const r2 = flatten(await Promise.all(r)); + const r3 = await Promise.all(r); + for (const r4 of r3) { + if ( + this.webdavConfig.address.includes("jianguoyun.com") && + r4.length >= 749 + ) { + // https://help.jianguoyun.com/?p=2064 + // no more than 750 per request + throw Error( + `出错:坚果云 api 有限制,文件列表加载不全。终止同步!` + ); + } + } + const r2 = flatten(r3); subContents.push(...r2); } for (let i = 0; i < subContents.length; ++i) {