π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Clean up code
Neeraj Gupta6e4d17cdb907
diff --git a/apps/cast/src/utils/file/index.ts b/apps/cast/src/utils/file/index.tsindex 8d7a314aaa..9900cd3f94 100644--- a/apps/cast/src/utils/file/index.ts+++ b/apps/cast/src/utils/file/index.ts@@ -2,17 +2,13 @@ import { SelectedState } from 'types/gallery';import {EnteFile,EncryptedEnteFile,- FileWithUpdatedMagicMetadata,FileMagicMetadata,- FileMagicMetadataProps,FilePublicMagicMetadata,} from 'types/file';import { decodeLivePhoto } from 'services/livePhotoService';import { getFileType } from 'services/typeDetectionService';import { logError } from '@ente/shared/sentry';import {- TYPE_JPEG,- TYPE_JPG,TYPE_HEIC,TYPE_HEIF,FILE_TYPE,@@ -22,12 +18,10 @@ import {import CastDownloadManager from 'services/castDownloadManager';import heicConversionService from 'services/heicConversionService';import * as ffmpegService from 'services/ffmpeg/ffmpegService';-import { VISIBILITY_STATE } from 'types/magicMetadata';-import { isArchivedFile, updateMagicMetadata } from 'utils/magicMetadata';+import { isArchivedFile } from 'utils/magicMetadata';import { CustomError } from '@ente/shared/error';import ComlinkCryptoWorker from 'utils/comlink/ComlinkCryptoWorker';-import { updateFileMagicMetadata } from 'services/fileService';import isElectron from 'is-electron';import { isPlaybackPossible } from 'utils/photoFrame';import { FileTypeInfo } from 'types/upload';@@ -48,37 +42,6 @@ export enum FILE_OPS_TYPE {DELETE_PERMANENTLY,}-export function downloadAsFile(filename: string, content: string) {- const file = new Blob([content], {- type: 'text/plain',- });- const fileURL = URL.createObjectURL(file);- downloadUsingAnchor(fileURL, filename);-}--export async function getUpdatedEXIFFileForDownload(- fileReader: FileReader,- file: EnteFile,- fileStream: ReadableStream<Uint8Array>-): Promise<ReadableStream<Uint8Array>> {- const extension = getFileExtension(file.metadata.title);- if (- file.metadata.fileType === FILE_TYPE.IMAGE &&- file.pubMagicMetadata?.data.editedTime &&- (extension === TYPE_JPEG || extension === TYPE_JPG)- ) {- const fileBlob = await new Response(fileStream).blob();- const updatedFileBlob = await updateFileCreationDateInEXIF(- fileReader,- fileBlob,- new Date(file.pubMagicMetadata.data.editedTime / 1000)- );- return updatedFileBlob.stream();- } else {- return fileStream;- }-}-export function groupFilesBasedOnCollectionID(files: EnteFile[]) {const collectionWiseFiles = new Map<number, EnteFile[]>();for (const file of files) {@@ -414,28 +377,6 @@ export function isSupportedRawFormat(exactType: string) {return SUPPORTED_RAW_FORMATS.includes(exactType.toLowerCase());}-export async function changeFilesVisibility(- files: EnteFile[],- visibility: VISIBILITY_STATE-): Promise<EnteFile[]> {- const fileWithUpdatedMagicMetadataList: FileWithUpdatedMagicMetadata[] = [];- for (const file of files) {- const updatedMagicMetadataProps: FileMagicMetadataProps = {- visibility,- };-- fileWithUpdatedMagicMetadataList.push({- file,- updatedMagicMetadata: await updateMagicMetadata(- updatedMagicMetadataProps,- file.magicMetadata,- file.key- ),- });- }- return await updateFileMagicMetadata(fileWithUpdatedMagicMetadataList);-}-export function mergeMetadata(files: EnteFile[]): EnteFile[] {return files.map((file) => {if (file.pubMagicMetadata?.data.editedTime) {diff --git a/apps/photos/public/locales/en/translation.json b/apps/photos/public/locales/en/translation.jsonindex c0274daac5..a6f46405df 100644--- a/apps/photos/public/locales/en/translation.json+++ b/apps/photos/public/locales/en/translation.json@@ -625,7 +625,6 @@"FASTER_UPLOAD_DESCRIPTION": "Route uploads through nearby servers","MAGIC_SEARCH_STATUS": "Magic Search Status","INDEXED_ITEMS": "Indexed items",-<<<<<<< HEAD"CAST_ALBUM_TO_TV": "Play album on TV","ENTER_CAST_PIN_CODE": "Enter the code you see on the TV below to pair this device.","PAIR_DEVICE_TO_TV": "Pair devices",diff --git a/packages/shared/batch/index.ts b/packages/shared/batch/index.tsdeleted file mode 100644index 3472c116e9..0000000000--- a/packages/shared/batch/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export function batch<T>(arr: T[], batchSize: number): T[][] {- const batches: T[][] = [];- for (let i = 0; i < arr.length; i += batchSize) {- batches.push(arr.slice(i, i + batchSize));- }- return batches;-}