Compare commits

..
3 Commits
Author SHA1 Message Date
fyears 26a426dda8 bump to 0.4.23
Release A New Version / build (16.x) (push) Failing after 42s
2024-05-24 22:42:21 +08:00
fyears de64c3c53f fix condition for partial update 2024-05-24 22:41:43 +08:00
fyears 0cefafa491 special treatment for jianguoyun 2024-05-24 22:08:02 +08:00
4 changed files with 32 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "remotely-save",
"name": "Remotely Save",
"version": "0.4.22",
"version": "0.4.23",
"minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "remotely-save",
"name": "Remotely Save",
"version": "0.4.22",
"version": "0.4.23",
"minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "remotely-save",
"version": "0.4.22",
"version": "0.4.23",
"description": "This is yet another sync plugin for Obsidian app.",
"scripts": {
"dev2": "node esbuild.config.mjs --watch",
+29 -4
View File
@@ -422,7 +422,20 @@ export class FakeFsWebdav extends FakeFs {
// glob: "/**" /* avoid dot files by using glob */,
}) 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);
}
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 {
if (this.isNextcloud) {
return await this._writeFileFromRootNextcloud(
@@ -555,10 +580,10 @@ export class FakeFsWebdav extends FakeFs {
origKey
);
}
throw Error(`no partial upload / update`);
throw Error(`Error: partial upload / update method is not implemented??`);
} catch (e) {
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);
throw e;