Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathi4ad35603870e
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index 1ba021dbca..670e53f445 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -87,6 +87,7 @@ import {
TRASH_SECTION,
} from "ente-new/photos/services/collection";
import type { CollectionSummaries } from "ente-new/photos/services/collection/ui";
+import exportService from "ente-new/photos/services/export";
import { isMLSupported } from "ente-new/photos/services/ml";
import {
isDevBuildAndUser,
@@ -130,7 +131,6 @@ import React, {
} from "react";
import { Trans } from "react-i18next";
import { getUncategorizedCollection } from "services/collectionService";
-import exportService from "services/export";
import { testUpload } from "../../tests/upload.test";
import { SubscriptionCard } from "./SubscriptionCard";
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index 6954ec5bc0..5375e7544c 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -29,6 +29,7 @@ import {
updateReadyToInstallDialogAttributes,
} from "ente-new/photos/components/utils/download";
import { useLoadingBar } from "ente-new/photos/components/utils/use-loading-bar";
+import { resumeExportsIfNeeded } from "ente-new/photos/services/export";
import { runMigrations } from "ente-new/photos/services/migration";
import { initML, isMLSupported } from "ente-new/photos/services/ml";
import { getFamilyPortalRedirectURL } from "ente-new/photos/services/user-details";
@@ -43,7 +44,6 @@ import { t } from "i18next";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { useCallback, useEffect, useMemo, useState } from "react";
-import { resumeExportsIfNeeded } from "services/export";
import { photosLogout } from "services/logout";
import {
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index f102a921f2..3577abb390 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -7,7 +7,6 @@ import CollectionNamer, {
CollectionNamerAttributes,
} from "components/Collections/CollectionNamer";
import { GalleryBarAndListHeader } from "components/Collections/GalleryBarAndListHeader";
-import { Export } from "components/Export";
import { TimeStampListItem } from "components/FileList";
import { FileListWithViewer } from "components/FileListWithViewer";
import {
@@ -49,6 +48,7 @@ import {
CollectionSelector,
type CollectionSelectorAttributes,
} from "ente-new/photos/components/CollectionSelector";
+import { Export } from "ente-new/photos/components/Export";
import { PlanSelector } from "ente-new/photos/components/PlanSelector";
import {
SearchBar,
@@ -77,6 +77,7 @@ import {
} from "ente-new/photos/services/collection";
import { areOnlySystemCollections } from "ente-new/photos/services/collection/ui";
import { getAllLocalCollections } from "ente-new/photos/services/collections";
+import exportService from "ente-new/photos/services/export";
import {
getLocalFiles,
getLocalTrashedFiles,
@@ -120,7 +121,6 @@ import {
createUnCategorizedCollection,
removeFromFavorites,
} from "services/collectionService";
-import exportService from "services/export";
import { uploadManager } from "services/upload-manager";
import {
GalleryContextType,
diff --git a/web/apps/photos/src/services/logout.ts b/web/apps/photos/src/services/logout.ts
index c17796a39a..a3f6792540 100644
--- a/web/apps/photos/src/services/logout.ts
+++ b/web/apps/photos/src/services/logout.ts
@@ -11,7 +11,7 @@ import { logoutML, terminateMLWorker } from "ente-new/photos/services/ml";
import { logoutSearch } from "ente-new/photos/services/search";
import { logoutSettings } from "ente-new/photos/services/settings";
import { logoutUserDetails } from "ente-new/photos/services/user-details";
-import exportService from "./export";
+import exportService from "ente-new/photos/services/export";
import { uploadManager } from "./upload-manager";
/**
diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.ts
index 66eb21ca7c..9b5d90257f 100644
--- a/web/apps/photos/src/utils/file/index.ts
+++ b/web/apps/photos/src/utils/file/index.ts
@@ -342,7 +342,6 @@ export const getUserOwnedFiles = (files: EnteFile[]) => {
return files.filter((file) => file.ownerID === user.id);
};
-
export const shouldShowAvatar = (file: EnteFile, user: User) => {
if (!file || !user) {
return false;
diff --git a/web/apps/photos/src/components/Export.tsx b/web/packages/new/photos/components/Export.tsx
similarity index 98%
rename from web/apps/photos/src/components/Export.tsx
rename to web/packages/new/photos/components/Export.tsx
index e62c7e9ea7..888f83240c 100644
--- a/web/apps/photos/src/components/Export.tsx
+++ b/web/packages/new/photos/components/Export.tsx
@@ -1,3 +1,5 @@
+/* eslint-disable @typescript-eslint/ban-ts-comment */
+/* eslint-disable @typescript-eslint/no-unnecessary-condition */
import FolderIcon from "@mui/icons-material/Folder";
import {
Box,
@@ -34,7 +36,7 @@ import { ensureElectron } from "ente-base/electron";
import { formattedNumber } from "ente-base/i18n";
import { formattedDateTime } from "ente-base/i18n-date";
import log from "ente-base/log";
-import { EnteFile } from "ente-media/file";
+import { type EnteFile } from "ente-media/file";
import { ItemCard, PreviewItemTile } from "ente-new/photos/components/Tiles";
import { CustomError } from "ente-shared/error";
import { t } from "i18next";
@@ -43,7 +45,7 @@ import { Trans } from "react-i18next";
import {
areEqual,
FixedSizeList,
- ListChildComponentProps,
+ type ListChildComponentProps,
type ListItemKeySelector,
} from "react-window";
import exportService, {
@@ -52,7 +54,7 @@ import exportService, {
type ExportOpts,
type ExportProgress,
type ExportSettings,
-} from "services/export";
+} from "../services/export";
type ExportProps = ModalVisibilityProps & {
/**
@@ -136,6 +138,7 @@ export const Export: React.FC<ExportProps> = ({
setLastExportTime(exportRecord.lastAttemptTimestamp);
setPendingFiles(await exportService.pendingFiles(exportRecord));
} catch (e) {
+ // @ts-ignore
if (e.message !== CustomError.EXPORT_FOLDER_DOES_NOT_EXIST) {
log.error("syncExportRecord failed", e);
}
@@ -265,7 +268,11 @@ const ExportDirectory: React.FC<ExportDirectoryProps> = ({
</Stack>
);
-const DirectoryPath = ({ path }) => (
+interface DirectoryPathProps {
+ path: string;
+}
+
+const DirectoryPath: React.FC<DirectoryPathProps> = ({ path }) => (
<LinkButton onClick={() => void ensureElectron().openDirectory(path)}>
<Tooltip title={path}>
<EllipsizedTypography
diff --git a/web/packages/new/photos/services/export-migration.ts b/web/packages/new/photos/services/export-migration.ts
index 94cd037964..ee5e390537 100644
--- a/web/packages/new/photos/services/export-migration.ts
+++ b/web/packages/new/photos/services/export-migration.ts
@@ -12,7 +12,6 @@ import { mergeMetadata, type EnteFile } from "ente-media/file";
import { FileType } from "ente-media/file-type";
import { decodeLivePhoto } from "ente-media/live-photo";
import { getLocalCollections } from "ente-new/photos/services/collections";
-import { exportMetadataDirectoryName } from "ente-new/photos/services/export";
import { getAllLocalFiles } from "ente-new/photos/services/files";
import {
safeDirectoryName,
@@ -23,6 +22,7 @@ import { getData } from "ente-shared/storage/localStorage";
import type { User } from "ente-shared/user/types";
import { wait } from "ente-utils/promise";
import exportService, {
+ exportMetadataDirectoryName,
getCollectionIDFromFileUID,
getExportRecordFileUID,
getLivePhotoExportName,