creationTime will always be present

This commit is contained in:
Manav Rathi
2024-07-25 15:45:04 +05:30
parent a4a4b7f941
commit 191f1fd097
2 changed files with 10 additions and 8 deletions

View File

@@ -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;

View File

@@ -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);
});