Add wrapper

This commit is contained in:
Manav Rathi 2024-08-07 10:33:53 +05:30
parent 7ecfa20f03
commit f4adea5a60
No known key found for this signature in database

View File

@ -0,0 +1,16 @@
import { decryptPublicMagicMetadata } from "@/media/file-metadata";
import { EnteFile } from "@/new/photos/types/file";
import ComlinkCryptoWorker from "@ente/shared/crypto";
/**
* On-demand decrypt the public magic metadata for an {@link EnteFile} for code
* running on the main thread.
*
* It both modifies the given file object, and also returns the decrypted
* metadata.
*/
export const getPublicMagicMetadataMT = async (enteFile: EnteFile) =>
decryptPublicMagicMetadata(
enteFile,
(await ComlinkCryptoWorker.getInstance()).decryptMetadata,
);