Get to a mergeable state

This commit is contained in:
Manav Rathi 2024-04-24 12:46:11 +05:30
parent d96f710d6d
commit 51a1c77720
No known key found for this signature in database
7 changed files with 16 additions and 14 deletions

View file

@ -212,6 +212,8 @@ const ffmpegExecWeb = async (
* *
* See also: {@link ffmpegExecWeb}. * See also: {@link ffmpegExecWeb}.
*/ */
/*
TODO(MR): Remove me
const ffmpegExecNative = async ( const ffmpegExecNative = async (
electron: Electron, electron: Electron,
command: string[], command: string[],
@ -227,6 +229,7 @@ const ffmpegExecNative = async (
return await worker.exec(command, blob, timeoutMs); return await worker.exec(command, blob, timeoutMs);
} }
}; };
*/
const ffmpegExec2 = async ( const ffmpegExec2 = async (
command: string[], command: string[],

View file

@ -18,7 +18,6 @@ import {
FileTypeInfo, FileTypeInfo,
Metadata, Metadata,
ParsedExtractedMetadata, ParsedExtractedMetadata,
type DataStream,
type LivePhotoAssets2, type LivePhotoAssets2,
type UploadAsset2, type UploadAsset2,
} from "types/upload"; } from "types/upload";
@ -30,6 +29,7 @@ import {
type ParsedMetadataJSON, type ParsedMetadataJSON,
} from "./takeout"; } from "./takeout";
import { getFileName } from "./uploadService"; import { getFileName } from "./uploadService";
import type { DataStream } from "@ente/shared/utils/data-stream";
const EXIF_TAGS_NEEDED = [ const EXIF_TAGS_NEEDED = [
"DateTimeOriginal", "DateTimeOriginal",

View file

@ -34,8 +34,6 @@ import {
UploadAsset, UploadAsset,
UploadFile, UploadFile,
UploadURL, UploadURL,
isDataStream,
type DataStream,
type FileWithCollection2, type FileWithCollection2,
type LivePhotoAssets, type LivePhotoAssets,
type LivePhotoAssets2, type LivePhotoAssets2,
@ -61,6 +59,7 @@ import {
} from "./thumbnail"; } from "./thumbnail";
import uploadCancelService from "./uploadCancelService"; import uploadCancelService from "./uploadCancelService";
import UploadHttpClient from "./uploadHttpClient"; import UploadHttpClient from "./uploadHttpClient";
import { isDataStream, type DataStream } from "@ente/shared/utils/data-stream";
/** Upload files to cloud storage */ /** Upload files to cloud storage */
class UploadService { class UploadService {

View file

@ -3,6 +3,7 @@ import {
B64EncryptionResult, B64EncryptionResult,
LocalFileAttributes, LocalFileAttributes,
} from "@ente/shared/crypto/types"; } from "@ente/shared/crypto/types";
import type { DataStream } from "@ente/shared/utils/data-stream";
import { FILE_TYPE } from "constants/file"; import { FILE_TYPE } from "constants/file";
import { Collection } from "types/collection"; import { Collection } from "types/collection";
import { import {
@ -92,15 +93,6 @@ export interface UploadURL {
objectKey: string; objectKey: string;
} }
export interface DataStream {
stream: ReadableStream<Uint8Array>;
chunkCount: number;
}
export function isDataStream(object: any): object is DataStream {
return "stream" in object;
}
export interface FileInMemory { export interface FileInMemory {
filedata: Uint8Array | DataStream; filedata: Uint8Array | DataStream;
/** The JPEG data of the generated thumbnail */ /** The JPEG data of the generated thumbnail */

View file

@ -1,7 +1,7 @@
import { getFileNameSize } from "@/next/file"; import { getFileNameSize } from "@/next/file";
import type { DataStream } from "@ente/shared/utils/data-stream";
import { FILE_READER_CHUNK_SIZE, PICKED_UPLOAD_TYPE } from "constants/upload"; import { FILE_READER_CHUNK_SIZE, PICKED_UPLOAD_TYPE } from "constants/upload";
import { getElectronFileStream, getFileStream } from "services/readerService"; import { getElectronFileStream, getFileStream } from "services/readerService";
import { DataStream } from "types/upload";
import { getImportSuggestion } from "utils/upload"; import { getImportSuggestion } from "utils/upload";
// This was for used to verify that converting from the browser readable stream // This was for used to verify that converting from the browser readable stream

View file

@ -1,4 +1,4 @@
import { DataStream } from "@/next/types/file"; import type { DataStream } from "../utils/data-stream";
export interface LocalFileAttributes< export interface LocalFileAttributes<
T extends string | Uint8Array | DataStream, T extends string | Uint8Array | DataStream,

View file

@ -0,0 +1,8 @@
export interface DataStream {
stream: ReadableStream<Uint8Array>;
chunkCount: number;
}
export function isDataStream(object: any): object is DataStream {
return "stream" in object;
}