Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rename

Manav Rathid1951a1f1082
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index 6ef10876c5..ea797f5045 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -25,7 +25,7 @@ import { sortCollectionSummaries } from "services/collectionService";
import {
isFilesDownloadCancelled,
isFilesDownloadCompleted,
-} from "../FilesDownloadProgress";
+} from "../DownloadProgress";
import { AlbumCastDialog } from "./AlbumCastDialog";
import {
CollectionHeader,
diff --git a/web/apps/photos/src/components/FilesDownloadProgress.tsx b/web/apps/photos/src/components/DownloadProgress.tsx
similarity index 100%
rename from web/apps/photos/src/components/FilesDownloadProgress.tsx
rename to web/apps/photos/src/components/DownloadProgress.tsx
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 565cef4e5f..334910b2d8 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -4,12 +4,12 @@ import MenuIcon from "@mui/icons-material/Menu";
import { IconButton, Stack, Typography } from "@mui/material";
import { AuthenticateUser } from "components/AuthenticateUser";
import { GalleryBarAndListHeader } from "components/Collections/GalleryBarAndListHeader";
-import { type TimeStampListItem } from "components/FileList";
-import { FileListWithViewer } from "components/FileListWithViewer";
import {
FilesDownloadProgress,
type FilesDownloadProgressAttributes,
-} from "components/FilesDownloadProgress";
+} from "components/DownloadProgress";
+import { type TimeStampListItem } from "components/FileList";
+import { FileListWithViewer } from "components/FileListWithViewer";
import { FixCreationTime } from "components/FixCreationTime";
import { Sidebar } from "components/Sidebar";
import { Upload } from "components/Upload";
@@ -41,6 +41,10 @@ import {
import { savedAuthToken } from "ente-base/token";
import { FullScreenDropZone } from "ente-gallery/components/FullScreenDropZone";
import { type UploadTypeSelectorIntent } from "ente-gallery/components/Upload";
+import type {
+ SetFilesDownloadProgressAttributes,
+ SetFilesDownloadProgressAttributesCreator,
+} from "ente-gallery/services/save";
import { type Collection } from "ente-media/collection";
import { type EnteFile } from "ente-media/file";
import { type ItemVisibility } from "ente-media/file-metadata";
@@ -123,13 +127,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import type { FileWithPath } from "react-dropzone";
import { Trans } from "react-i18next";
import { uploadManager } from "services/upload-manager";
-import type {
- SelectedState,
-} from "types/gallery";
-import type {
- SetFilesDownloadProgressAttributes,
- SetFilesDownloadProgressAttributesCreator,
-} from "ente-gallery/services/save";
+import type { SelectedState } from "types/gallery";
import { getSelectedFiles, performFileOp } from "utils/file";
/**
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx
index 88b140a2ed..85865797df 100644
--- a/web/apps/photos/src/pages/shared-albums.tsx
+++ b/web/apps/photos/src/pages/shared-albums.tsx
@@ -6,9 +6,9 @@ import DownloadIcon from "@mui/icons-material/Download";
import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
import { Box, Button, IconButton, Stack, styled, Tooltip } from "@mui/material";
import Typography from "@mui/material/Typography";
+import { FilesDownloadProgress } from "components/DownloadProgress";
import type { TimeStampListItem } from "components/FileList";
import { FileListWithViewer } from "components/FileListWithViewer";
-import { FilesDownloadProgress } from "components/FilesDownloadProgress";
import { Upload } from "components/Upload";
import {
AccountsPageContents,
diff --git a/web/apps/photos/src/types/gallery/index.ts b/web/apps/photos/src/types/gallery/index.ts
index 8a27adc307..47f1f1c1b7 100644
--- a/web/apps/photos/src/types/gallery/index.ts
+++ b/web/apps/photos/src/types/gallery/index.ts
@@ -1,4 +1,3 @@
-import { type FilesDownloadProgressAttributes } from "components/FilesDownloadProgress";
import { type SelectionContext } from "ente-new/photos/components/gallery";
export interface SelectedState {
@@ -18,7 +17,6 @@ export type SetSelectedState = React.Dispatch<
>;
export type SetLoading = React.Dispatch<React.SetStateAction<boolean>>;
-
export interface MergedSourceURL {
original: string;
converted: string;
diff --git a/web/packages/gallery/services/save.ts b/web/packages/gallery/services/save.ts
index a3c59e4635..627f76e8a8 100644
--- a/web/packages/gallery/services/save.ts
+++ b/web/packages/gallery/services/save.ts
@@ -256,13 +256,13 @@ const saveFileDesktop = async (
) => {
const fs = electron.fs;
- const createSafeName = (fileName: string) =>
+ const createExportName = (fileName: string) =>
safeFileName(directoryPath, fileName, fs.exists);
const writeStreamToFile = (
- fileName: string,
+ exportName: string,
stream: ReadableStream<Uint8Array> | null,
- ) => writeStream(electron, joinPath(directoryPath, fileName), stream);
+ ) => writeStream(electron, joinPath(directoryPath, exportName), stream);
const stream = await downloadManager.fileStream(file);
const fileName = fileFileName(file);
@@ -270,11 +270,11 @@ const saveFileDesktop = async (
if (file.metadata.fileType == FileType.livePhoto) {
const { imageFileName, imageData, videoFileName, videoData } =
await decodeLivePhoto(fileName, await new Response(stream).blob());
- const imageExportName = await createSafeName(imageFileName);
+ const imageExportName = await createExportName(imageFileName);
await writeStreamToFile(imageExportName, new Response(imageData).body);
try {
await writeStreamToFile(
- await createSafeName(videoFileName),
+ await createExportName(videoFileName),
new Response(videoData).body,
);
} catch (e) {
@@ -282,7 +282,7 @@ const saveFileDesktop = async (
throw e;
}
} else {
- await writeStreamToFile(await createSafeName(fileName), stream);
+ await writeStreamToFile(await createExportName(fileName), stream);
}
};