Merge
This commit is contained in:
@@ -30,8 +30,7 @@ import {
|
||||
CollectionsSortBy,
|
||||
} from "@/new/photos/services/collection/ui";
|
||||
import { getLocalFiles, sortFiles } from "@/new/photos/services/files";
|
||||
import { EnteFile } from "@/new/photos/types/file";
|
||||
import { EncryptedMagicMetadata } from "@/new/photos/types/magicMetadata";
|
||||
import { EncryptedMagicMetadata, EnteFile } from "@/new/photos/types/file";
|
||||
import { batch } from "@/utils/array";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
setLocalFiles,
|
||||
sortFiles,
|
||||
} from "@/new/photos/services/files";
|
||||
import type { EncryptedMagicMetadata } from "@/new/photos/types/file";
|
||||
import {
|
||||
EncryptedEnteFile,
|
||||
EnteFile,
|
||||
@@ -27,7 +28,6 @@ import {
|
||||
REQUEST_BATCH_SIZE,
|
||||
setCollectionLastSyncTime,
|
||||
} from "./collectionService";
|
||||
import type { EncryptedMagicMetadata } from "@/new/photos/types/magicMetadata";
|
||||
|
||||
/**
|
||||
* Fetch all files of the given {@link type}, belonging to the given
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
UPLOAD_RESULT,
|
||||
} from "@/new/photos/services/upload/types";
|
||||
import {
|
||||
EncryptedMagicMetadata,
|
||||
EnteFile,
|
||||
MetadataFileAttributes,
|
||||
S3FileAttributes,
|
||||
@@ -30,7 +31,6 @@ import {
|
||||
type FilePublicMagicMetadata,
|
||||
type FilePublicMagicMetadataProps,
|
||||
} from "@/new/photos/types/file";
|
||||
import { EncryptedMagicMetadata } from "@/new/photos/types/magicMetadata";
|
||||
import { detectFileTypeInfoFromChunk } from "@/new/photos/utils/detect-type";
|
||||
import { readStream } from "@/new/photos/utils/native-stream";
|
||||
import { ensure, ensureInteger, ensureNumber } from "@/utils/ensure";
|
||||
|
||||
@@ -6,11 +6,11 @@ import {
|
||||
CollectionMagicMetadataProps,
|
||||
CollectionPublicMagicMetadataProps,
|
||||
CollectionType,
|
||||
SUB_TYPE,
|
||||
} from "@/media/collection";
|
||||
import { ItemVisibility } from "@/media/file-metadata";
|
||||
import { getAllLocalFiles, getLocalFiles } from "@/new/photos/services/files";
|
||||
import { EnteFile } from "@/new/photos/types/file";
|
||||
import { SUB_TYPE } from "@/media/collection";
|
||||
import { safeDirectoryName } from "@/new/photos/utils/native-fs";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { sharedCryptoWorker } from "@/base/crypto";
|
||||
import type { Collection } from "@/media/collection";
|
||||
import { ItemVisibility } from "@/media/file-metadata";
|
||||
import { EnteFile } from "@/new/photos/types/file";
|
||||
import { MagicMetadataCore } from "@/new/photos/types/magicMetadata";
|
||||
import { EnteFile, MagicMetadataCore } from "@/new/photos/types/file";
|
||||
|
||||
export function isArchivedFile(item: EnteFile): boolean {
|
||||
if (!item || !item.magicMetadata || !item.magicMetadata.data) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { EnteFile } from "@/new/photos/types/file";
|
||||
import {
|
||||
type EncryptedMagicMetadata,
|
||||
type MagicMetadataCore,
|
||||
} from "@/new/photos/types/magicMetadata";
|
||||
} from "@/new/photos/types/file";
|
||||
|
||||
// TODO: Audit this file
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import { type Metadata, ItemVisibility } from "@/media/file-metadata";
|
||||
import {
|
||||
type EncryptedMagicMetadata,
|
||||
type MagicMetadataCore,
|
||||
} from "./magicMetadata";
|
||||
|
||||
export interface MetadataFileAttributes {
|
||||
encryptedData: string;
|
||||
@@ -18,6 +14,15 @@ export interface FileInfo {
|
||||
thumbSize: number;
|
||||
}
|
||||
|
||||
export interface MagicMetadataCore<T> {
|
||||
version: number;
|
||||
count: number;
|
||||
header: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
export type EncryptedMagicMetadata = MagicMetadataCore<string>;
|
||||
|
||||
export interface EncryptedEnteFile {
|
||||
id: number;
|
||||
collectionID: number;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
export interface MagicMetadataCore<T> {
|
||||
version: number;
|
||||
count: number;
|
||||
header: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
export type EncryptedMagicMetadata = MagicMetadataCore<string>;
|
||||
Reference in New Issue
Block a user