Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix and imp

Manav Rathi4f1d3c23f5c8
diff --git a/web/packages/new/photos/services/dedup.ts b/web/packages/new/photos/services/dedup.ts
index 3c9998ec91..0c576cde17 100644
--- a/web/packages/new/photos/services/dedup.ts
+++ b/web/packages/new/photos/services/dedup.ts
@@ -1,3 +1,4 @@
+import { assertionFailed } from "@/base/assert";
import { newID } from "@/base/id";
import type { EnteFile } from "@/media/file";
import { metadataHash } from "@/media/file-metadata";
@@ -133,6 +134,9 @@ export const deduceDuplicates = async () => {
const collectionName = collectionNameByID.get(
file.collectionID,
);
+ // Ignore duplicates for which we do not have a collection. This
+ // shouldn't really happen though, so retain an assert.
+ if (!collectionName) assertionFailed();
return collectionName ? { file, collectionName } : undefined;
})
.filter((item) => !!item);
@@ -146,8 +150,8 @@ export const deduceDuplicates = async () => {
id: newID("dg_"),
items,
itemSize: size,
- prunableCount: duplicates.length - 1,
- prunableSize: size * (duplicates.length - 1),
+ prunableCount: items.length - 1,
+ prunableSize: size * (items.length - 1),
isSelected: true,
});
}