Consolidate constants
This commit is contained in:
parent
63a2ca7606
commit
4f764dc77c
7 changed files with 18 additions and 19 deletions
|
@ -10,9 +10,9 @@ import {
|
|||
LinearProgress,
|
||||
styled,
|
||||
} from "@mui/material";
|
||||
import { ExportStage } from "constants/export";
|
||||
import { t } from "i18next";
|
||||
import { Trans } from "react-i18next";
|
||||
import { ExportStage } from "services/export";
|
||||
import { ExportProgress } from "types/export";
|
||||
|
||||
export const ComfySpan = styled("span")`
|
||||
|
|
|
@ -14,12 +14,11 @@ import {
|
|||
Switch,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { ExportStage } from "constants/export";
|
||||
import { t } from "i18next";
|
||||
import isElectron from "is-electron";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import exportService from "services/export";
|
||||
import exportService, { ExportStage } from "services/export";
|
||||
import { ExportProgress, ExportSettings } from "types/export";
|
||||
import { EnteFile } from "types/file";
|
||||
import { getExportDirectoryDoesNotExistMessage } from "utils/ui";
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
export const ENTE_METADATA_FOLDER = "metadata";
|
||||
|
||||
export enum ExportStage {
|
||||
INIT = 0,
|
||||
MIGRATION = 1,
|
||||
STARTING = 2,
|
||||
EXPORTING_FILES = 3,
|
||||
TRASHING_DELETED_FILES = 4,
|
||||
RENAMING_COLLECTION_FOLDERS = 5,
|
||||
TRASHING_DELETED_COLLECTIONS = 6,
|
||||
FINISHED = 7,
|
||||
}
|
|
@ -10,7 +10,6 @@ import QueueProcessor, {
|
|||
CancellationStatus,
|
||||
RequestCanceller,
|
||||
} from "@ente/shared/utils/queueProcessor";
|
||||
import { ENTE_METADATA_FOLDER, ExportStage } from "constants/export";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { Collection } from "types/collection";
|
||||
import {
|
||||
|
@ -50,6 +49,19 @@ const EXPORT_RECORD_FILE_NAME = "export_status.json";
|
|||
|
||||
export const ENTE_EXPORT_DIRECTORY = "ente Photos";
|
||||
|
||||
export const ENTE_METADATA_FOLDER = "metadata";
|
||||
|
||||
export enum ExportStage {
|
||||
INIT = 0,
|
||||
MIGRATION = 1,
|
||||
STARTING = 2,
|
||||
EXPORTING_FILES = 3,
|
||||
TRASHING_DELETED_FILES = 4,
|
||||
RENAMING_COLLECTION_FOLDERS = 5,
|
||||
TRASHING_DELETED_COLLECTIONS = 6,
|
||||
FINISHED = 7,
|
||||
}
|
||||
|
||||
export const NULL_EXPORT_RECORD: ExportRecord = {
|
||||
version: 3,
|
||||
lastAttemptTimestamp: null,
|
||||
|
|
|
@ -2,7 +2,6 @@ import log from "@/next/log";
|
|||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import { User } from "@ente/shared/user/types";
|
||||
import { sleep } from "@ente/shared/utils";
|
||||
import { ENTE_METADATA_FOLDER } from "constants/export";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { getLocalCollections } from "services/collectionService";
|
||||
import downloadManager from "services/download";
|
||||
|
@ -29,6 +28,7 @@ import {
|
|||
} from "utils/file";
|
||||
import { sanitizeName } from "utils/native-fs";
|
||||
import {
|
||||
ENTE_METADATA_FOLDER,
|
||||
getCollectionIDFromFileUID,
|
||||
getExportRecordFileUID,
|
||||
getLivePhotoExportName,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ExportStage } from "constants/export";
|
||||
import type { ExportStage } from "services/export";
|
||||
import { EnteFile } from "types/file";
|
||||
|
||||
export interface ExportProgress {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { ENTE_METADATA_FOLDER } from "constants/export";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import {
|
||||
A_SEC_IN_MICROSECONDS,
|
||||
|
@ -6,6 +5,7 @@ import {
|
|||
PICKED_UPLOAD_TYPE,
|
||||
} from "constants/upload";
|
||||
import isElectron from "is-electron";
|
||||
import { ENTE_METADATA_FOLDER } from "services/export";
|
||||
import { EnteFile } from "types/file";
|
||||
import {
|
||||
ElectronFile,
|
||||
|
|
Loading…
Add table
Reference in a new issue