very basic synthesizedFolder

This commit is contained in:
fyears
2024-03-30 03:30:18 +08:00
parent c37bf6aedd
commit 791c0e8df6
4 changed files with 67 additions and 6 deletions
+10 -2
View File
@@ -250,6 +250,7 @@ const fromS3ObjectToEntity = (
mtimeCli: mtimeCli,
sizeRaw: x.Size!,
etag: x.ETag,
synthesizedFolder: false,
};
return r;
};
@@ -599,7 +600,10 @@ export const listAllFromRemote = async (
s3Client: S3Client,
s3Config: S3Config
) => {
return await listFromRemoteRaw(s3Client, s3Config, s3Config.remotePrefix);
const res = (
await listFromRemoteRaw(s3Client, s3Config, s3Config.remotePrefix)
).filter((x) => x.keyRaw !== "" && x.keyRaw !== "/");
return res;
};
/**
@@ -715,11 +719,15 @@ export const deleteFromRemote = async (
s3Config: S3Config,
fileOrFolderPath: string,
cipher: Cipher,
remoteEncryptedKey: string = ""
remoteEncryptedKey: string = "",
synthesizedFolder: boolean = false
) => {
if (fileOrFolderPath === "/") {
return;
}
if (synthesizedFolder) {
return;
}
let remoteFileName = fileOrFolderPath;
if (!cipher.isPasswordEmpty()) {
remoteFileName = remoteEncryptedKey;