Skip to content

armgit / ente

Public Imported from GitHub
0

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

creationTime will always be present

Manav Rathi191f1fd09794
diff --git a/web/packages/media/types/file.ts b/web/packages/media/types/file.ts
index f41a34219e..fbffb1bd39 100644
--- a/web/packages/media/types/file.ts
+++ b/web/packages/media/types/file.ts
@@ -58,16 +58,20 @@ export interface Metadata {
*/
title: string;
/**
- * The time when this file was created.
+ * The time when this file was created (epoch microseconds).
*
- * For photos (and images in general), this is the time when the photo was
- * taken, or when the screenshot was captured.
+ * For photos (and images in general), this is our best attempt (using Exif
+ * and other metadata, or deducing it from file name for screenshots without
+ * any embedded metadata) at detecting the time when the photo was taken.
+ *
+ * If nothing can be found, then it is set to the current time at the time
+ * of the upload.
*/
- creationTime: number | undefined;
+ creationTime: number;
modificationTime: number;
latitude: number;
longitude: number;
- /** The "Ente" file type. */
+ /** The "Ente" file type - image, video or live photo. */
fileType: FILE_TYPE;
hasStaticThumbnail?: boolean;
hash?: string;
diff --git a/web/packages/new/photos/services/files.ts b/web/packages/new/photos/services/files.ts
index 9d29a5e160..6a0ad4faa1 100644
--- a/web/packages/new/photos/services/files.ts
+++ b/web/packages/new/photos/services/files.ts
@@ -68,9 +68,7 @@ const sortTrashFiles = (files: EnteFile[]) => {
b.metadata.modificationTime - a.metadata.modificationTime
);
}
- return (
- (b.metadata.creationTime ?? 0) - (a.metadata.creationTime ?? 0)
- );
+ return b.metadata.creationTime - a.metadata.creationTime;
}
return (a.deleteBy ?? 0) - (b.deleteBy ?? 0);
});