Reuse
This commit is contained in:
parent
0566d2ee93
commit
c486919547
28 changed files with 27 additions and 34 deletions
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { PHOTOS_PAGES } from "@ente/shared/constants/pages";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
|
@ -5,7 +6,6 @@ import useMemoSingleThreaded from "@ente/shared/hooks/useMemoSingleThreaded";
|
|||
import { styled } from "@mui/material";
|
||||
import PhotoViewer from "components/PhotoViewer";
|
||||
import { TRASH_SECTION } from "constants/collection";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { useRouter } from "next/router";
|
||||
import { GalleryContext } from "pages/gallery";
|
||||
import PhotoSwipe from "photoswipe";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { nameAndExtension } from "@/next/file";
|
||||
import log from "@/next/log";
|
||||
import { FlexWrapper } from "@ente/shared/components/Container";
|
||||
import PhotoOutlined from "@mui/icons-material/PhotoOutlined";
|
||||
import VideocamOutlined from "@mui/icons-material/VideocamOutlined";
|
||||
import Box from "@mui/material/Box";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { useEffect, useState } from "react";
|
||||
import { EnteFile } from "types/file";
|
||||
import { makeHumanReadableStorage } from "utils/billing";
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
isSupportedRawFormat,
|
||||
} from "utils/file";
|
||||
|
||||
import { FILE_TYPE } from "@/media/file";
|
||||
import { FlexWrapper } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import AlbumOutlined from "@mui/icons-material/AlbumOutlined";
|
||||
|
@ -34,7 +35,6 @@ import InfoIcon from "@mui/icons-material/InfoOutlined";
|
|||
import ReplayIcon from "@mui/icons-material/Replay";
|
||||
import ZoomInOutlinedIcon from "@mui/icons-material/ZoomInOutlined";
|
||||
import { Box, Button, styled } from "@mui/material";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import {
|
||||
defaultLivePhotoDefaultOptions,
|
||||
photoSwipeV4Events,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { Overlay } from "@ente/shared/components/Container";
|
||||
import PhotoOutlined from "@mui/icons-material/PhotoOutlined";
|
||||
import PlayCircleOutlineOutlined from "@mui/icons-material/PlayCircleOutlineOutlined";
|
||||
import { styled } from "@mui/material";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
|
||||
interface Iprops {
|
||||
fileType: FILE_TYPE;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import { IconButton } from "@mui/material";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { t } from "i18next";
|
||||
import memoize from "memoize-one";
|
||||
import pDebounce from "p-debounce";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { Overlay } from "@ente/shared/components/Container";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
|
@ -11,7 +12,6 @@ import {
|
|||
StaticThumbnail,
|
||||
} from "components/PlaceholderThumbnails";
|
||||
import { TRASH_SECTION } from "constants/collection";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { GAP_BTW_TILES, IMAGE_CONTAINER_MAX_WIDTH } from "constants/gallery";
|
||||
import { DeduplicateContext } from "pages/deduplicate";
|
||||
import { GalleryContext } from "pages/gallery";
|
||||
|
|
|
@ -9,13 +9,6 @@ export const TYPE_HEIF = "heif";
|
|||
export const TYPE_JPEG = "jpeg";
|
||||
export const TYPE_JPG = "jpg";
|
||||
|
||||
export enum FILE_TYPE {
|
||||
IMAGE,
|
||||
VIDEO,
|
||||
LIVE_PHOTO,
|
||||
OTHERS,
|
||||
}
|
||||
|
||||
export const RAW_FORMATS = [
|
||||
"heic",
|
||||
"rw2",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { ENCRYPTION_CHUNK_SIZE } from "@ente/shared/crypto/constants";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { FileTypeInfo, Location } from "types/upload";
|
||||
|
||||
// list of format that were missed by type-detection for some files.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { ensureElectron } from "@/next/electron";
|
||||
import log from "@/next/log";
|
||||
import ComlinkCryptoWorker from "@ente/shared/crypto";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import { Events, eventBus } from "@ente/shared/events";
|
||||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import isElectron from "is-electron";
|
||||
import PQueue from "p-queue";
|
||||
import { Embedding } from "types/embedding";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
import { getEndpoint } from "@ente/shared/network/api";
|
||||
import { getToken } from "@ente/shared/storage/localStorage/helpers";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { EnteFile } from "types/file";
|
||||
import { Metadata } from "types/upload";
|
||||
import { hasFileHash } from "utils/upload";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { decodeLivePhoto } from "@/media/live-photo";
|
||||
import { openCache, type BlobCache } from "@/next/blob-cache";
|
||||
import log from "@/next/log";
|
||||
|
@ -8,7 +9,6 @@ import { CustomError } from "@ente/shared/error";
|
|||
import { Events, eventBus } from "@ente/shared/events";
|
||||
import { isPlaybackPossible } from "@ente/shared/media/video-playback";
|
||||
import { Remote } from "comlink";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import isElectron from "is-electron";
|
||||
import * as ffmpegService from "services/ffmpeg";
|
||||
import { EnteFile } from "types/file";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { decodeLivePhoto } from "@/media/live-photo";
|
||||
import { ensureElectron } from "@/next/electron";
|
||||
import log from "@/next/log";
|
||||
|
@ -11,7 +12,6 @@ import QueueProcessor, {
|
|||
CancellationStatus,
|
||||
RequestCanceller,
|
||||
} from "@ente/shared/utils/queueProcessor";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { Collection } from "types/collection";
|
||||
import {
|
||||
CollectionExportNames,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { decodeLivePhoto } from "@/media/live-photo";
|
||||
import { ensureElectron } from "@/next/electron";
|
||||
import log from "@/next/log";
|
||||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import { User } from "@ente/shared/user/types";
|
||||
import { wait } from "@ente/shared/utils";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { getLocalCollections } from "services/collectionService";
|
||||
import downloadManager from "services/download";
|
||||
import { getAllLocalFiles } from "services/fileService";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { ComlinkWorker } from "@/next/worker/comlink-worker";
|
||||
import { eventBus, Events } from "@ente/shared/events";
|
||||
import { getToken, getUserID } from "@ente/shared/storage/localStorage/helpers";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import debounce from "debounce";
|
||||
import PQueue from "p-queue";
|
||||
import { JobResult } from "types/common/job";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { MLSyncContext, MLSyncFileContext } from "types/machineLearning";
|
||||
import {
|
||||
getLocalFileImageBitmap,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import * as chrono from "chrono-node";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { t } from "i18next";
|
||||
import { Collection } from "types/collection";
|
||||
import { EntityType, LocationTag, LocationTagData } from "types/entity";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { ElectronFile } from "@/next/types/file";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import {
|
||||
KNOWN_NON_MEDIA_FORMATS,
|
||||
WHITELISTED_FILE_FORMATS,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { validateAndGetCreationUnixTimeInMicroSeconds } from "@ente/shared/time";
|
||||
import type { FixOption } from "components/FixCreationTime";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { getFileType } from "services/typeDetectionService";
|
||||
import { EnteFile } from "types/file";
|
||||
import {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { getFileNameSize } from "@/next/file";
|
||||
import log from "@/next/log";
|
||||
import { ElectronFile } from "@/next/types/file";
|
||||
|
@ -10,7 +11,6 @@ import {
|
|||
} from "@ente/shared/time";
|
||||
import type { DataStream } from "@ente/shared/utils/data-stream";
|
||||
import { Remote } from "comlink";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { FILE_READER_CHUNK_SIZE, NULL_LOCATION } from "constants/upload";
|
||||
import * as ffmpegService from "services/ffmpeg";
|
||||
import { getElectronFileStream, getFileStream } from "services/readerService";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { type Electron } from "@/next/types/ipc";
|
||||
import { withTimeout } from "@ente/shared/utils";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { BLACK_THUMBNAIL_BASE64 } from "constants/upload";
|
||||
import * as ffmpeg from "services/ffmpeg";
|
||||
import { heicToJPEG } from "services/heic-convert";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { potentialFileTypeFromExtension } from "@/media/live-photo";
|
||||
import { ensureElectron } from "@/next/electron";
|
||||
import { nameAndExtension } from "@/next/file";
|
||||
|
@ -11,7 +12,6 @@ import { Events, eventBus } from "@ente/shared/events";
|
|||
import { wait } from "@ente/shared/utils";
|
||||
import { Canceler } from "axios";
|
||||
import { Remote } from "comlink";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import {
|
||||
RANDOM_PERCENTAGE_PROGRESS_FOR_PUT,
|
||||
UPLOAD_RESULT,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { encodeLivePhoto } from "@/media/live-photo";
|
||||
import { ensureElectron } from "@/next/electron";
|
||||
import { basename } from "@/next/file";
|
||||
|
@ -9,7 +10,6 @@ import { EncryptionResult } from "@ente/shared/crypto/types";
|
|||
import { CustomError, handleUploadError } from "@ente/shared/error";
|
||||
import { isDataStream, type DataStream } from "@ente/shared/utils/data-stream";
|
||||
import { Remote } from "comlink";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import {
|
||||
FILE_CHUNKS_COMBINED_FOR_A_UPLOAD_PART,
|
||||
FILE_READER_CHUNK_SIZE,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { FILE_TYPE } from "constants/file";
|
||||
import { FILE_TYPE } from "@/media/file";
|
||||
import { City } from "services/locationSearchService";
|
||||
import { LocationTagData } from "types/entity";
|
||||
import { EnteFile } from "types/file";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import type { ElectronFile } from "@/next/types/file";
|
||||
import {
|
||||
B64EncryptionResult,
|
||||
LocalFileAttributes,
|
||||
} from "@ente/shared/crypto/types";
|
||||
import type { DataStream } from "@ente/shared/utils/data-stream";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { Collection } from "types/collection";
|
||||
import {
|
||||
FilePublicMagicMetadata,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { decodeLivePhoto } from "@/media/live-photo";
|
||||
import log from "@/next/log";
|
||||
import { CustomErrorMessage, type Electron } from "@/next/types/ipc";
|
||||
|
@ -7,7 +8,6 @@ import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
|||
import { User } from "@ente/shared/user/types";
|
||||
import { downloadUsingAnchor, withTimeout } from "@ente/shared/utils";
|
||||
import {
|
||||
FILE_TYPE,
|
||||
RAW_FORMATS,
|
||||
SUPPORTED_RAW_FORMATS,
|
||||
TYPE_HEIC,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { decodeLivePhoto } from "@/media/live-photo";
|
||||
import log from "@/next/log";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import PQueue from "p-queue";
|
||||
import DownloadManager from "services/download";
|
||||
import { getLocalFiles } from "services/fileService";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import log from "@/next/log";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { LivePhotoSourceURL, SourceURLs } from "services/download";
|
||||
import { EnteFile } from "types/file";
|
||||
import { SetSelectedState } from "types/gallery";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FILE_TYPE } from "@/media/file";
|
||||
import { tryToParseDateTime } from "@ente/shared/time";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { getLocalCollections } from "services/collectionService";
|
||||
import { getLocalFiles } from "services/fileService";
|
||||
import {
|
||||
|
|
Loading…
Add table
Reference in a new issue