Rename
This commit is contained in:
@@ -62,7 +62,7 @@ import { FlexWrapper } from "@ente/shared/components/Container";
|
||||
import SingleInputForm, {
|
||||
type SingleInputFormProps,
|
||||
} from "@ente/shared/components/SingleInputForm";
|
||||
import { getPublicMagicMetadataSync } from "@ente/shared/file-metadata";
|
||||
import { filePublicMagicMetadata } from "@ente/shared/file-metadata";
|
||||
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
||||
import CameraOutlinedIcon from "@mui/icons-material/CameraOutlined";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
@@ -669,7 +669,7 @@ const CreationTime: React.FC<CreationTimeProps> = ({
|
||||
const openEditMode = () => setIsInEditMode(true);
|
||||
const closeEditMode = () => setIsInEditMode(false);
|
||||
|
||||
const publicMagicMetadata = getPublicMagicMetadataSync(file);
|
||||
const publicMagicMetadata = filePublicMagicMetadata(file);
|
||||
const originalDate = fileCreationPhotoDate(file, publicMagicMetadata);
|
||||
|
||||
const saveEdits = async (pickedTime: ParsedMetadataDate) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Collection } from "@/media/collection";
|
||||
import type { EnteFile } from "@/media/file";
|
||||
import { fileCreationPhotoDate, fileLocation } from "@/media/file-metadata";
|
||||
import { nullToUndefined } from "@/utils/transform";
|
||||
import { getPublicMagicMetadataSync } from "@ente/shared/file-metadata";
|
||||
import { filePublicMagicMetadata } from "@ente/shared/file-metadata";
|
||||
import type { Component } from "chrono-node";
|
||||
import * as chrono from "chrono-node";
|
||||
import { expose } from "comlink";
|
||||
@@ -383,7 +383,7 @@ const isMatchingFile = (file: EnteFile, suggestion: SearchSuggestion) => {
|
||||
case "date":
|
||||
return isDateComponentsMatch(
|
||||
suggestion.dateComponents,
|
||||
fileCreationPhotoDate(file, getPublicMagicMetadataSync(file)),
|
||||
fileCreationPhotoDate(file, filePublicMagicMetadata(file)),
|
||||
);
|
||||
|
||||
case "location": {
|
||||
|
||||
@@ -15,9 +15,10 @@ import {
|
||||
* We are not expected to be in a scenario where the file gets to the UI without
|
||||
* having its public magic metadata decrypted, so this function is a sanity
|
||||
* check and should be a no-op in usually. On debug builds it'll throw if it
|
||||
* finds its assumptions broken.
|
||||
* finds its assumptions broken. Once the types have been refactored this entire
|
||||
* backup code-path can be removed, and this should become a trivial accessor.
|
||||
*/
|
||||
export const getPublicMagicMetadataSync = (file: EnteFile) => {
|
||||
export const filePublicMagicMetadata = (file: EnteFile) => {
|
||||
if (!file.pubMagicMetadata) return undefined;
|
||||
if (typeof file.pubMagicMetadata.data == "string") {
|
||||
if (isDevBuild)
|
||||
|
||||
Reference in New Issue
Block a user