Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26a426dda8 | ||
|
|
de64c3c53f | ||
|
|
0cefafa491 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "remotely-save",
|
"id": "remotely-save",
|
||||||
"name": "Remotely Save",
|
"name": "Remotely Save",
|
||||||
"version": "0.4.22",
|
"version": "0.4.23",
|
||||||
"minAppVersion": "0.13.21",
|
"minAppVersion": "0.13.21",
|
||||||
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
||||||
"author": "fyears",
|
"author": "fyears",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "remotely-save",
|
"id": "remotely-save",
|
||||||
"name": "Remotely Save",
|
"name": "Remotely Save",
|
||||||
"version": "0.4.22",
|
"version": "0.4.23",
|
||||||
"minAppVersion": "0.13.21",
|
"minAppVersion": "0.13.21",
|
||||||
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
||||||
"author": "fyears",
|
"author": "fyears",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "remotely-save",
|
"name": "remotely-save",
|
||||||
"version": "0.4.22",
|
"version": "0.4.23",
|
||||||
"description": "This is yet another sync plugin for Obsidian app.",
|
"description": "This is yet another sync plugin for Obsidian app.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev2": "node esbuild.config.mjs --watch",
|
"dev2": "node esbuild.config.mjs --watch",
|
||||||
|
|||||||
+29
-4
@@ -422,7 +422,20 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
// glob: "/**" /* avoid dot files by using glob */,
|
// glob: "/**" /* avoid dot files by using glob */,
|
||||||
}) as Promise<FileStat[]>;
|
}) as Promise<FileStat[]>;
|
||||||
});
|
});
|
||||||
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);
|
subContents.push(...r2);
|
||||||
}
|
}
|
||||||
for (let i = 0; i < subContents.length; ++i) {
|
for (let i = 0; i < subContents.length; ++i) {
|
||||||
@@ -536,7 +549,19 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// larger than 10 MB, try to upload by chunks
|
// larger than 10 MB
|
||||||
|
if (!this.isNextcloud && !this.supportNativePartial) {
|
||||||
|
// give up and upload by whole, and directly return
|
||||||
|
return await this._writeFileFromRootFull(
|
||||||
|
key,
|
||||||
|
content,
|
||||||
|
mtime,
|
||||||
|
ctime,
|
||||||
|
origKey
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// try to upload by chunks
|
||||||
try {
|
try {
|
||||||
if (this.isNextcloud) {
|
if (this.isNextcloud) {
|
||||||
return await this._writeFileFromRootNextcloud(
|
return await this._writeFileFromRootNextcloud(
|
||||||
@@ -555,10 +580,10 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
origKey
|
origKey
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
throw Error(`no partial upload / update`);
|
throw Error(`Error: partial upload / update method is not implemented??`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
console.error(
|
||||||
`we fail to write file partially, so downgrade to full and ignore the error:`
|
`we fail to write file partially for nextcloud or apache or sabre/dav, stop!`
|
||||||
);
|
);
|
||||||
console.error(e);
|
console.error(e);
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
Reference in New Issue
Block a user