This commit is contained in:
Manav Rathi 2024-04-23 21:03:54 +05:30
parent 5befc53d8c
commit 0da46f3298
No known key found for this signature in database
3 changed files with 9 additions and 9 deletions

View file

@ -17,7 +17,6 @@ import { getElectronFileStream, getFileStream } from "services/readerService";
import { getFileType } from "services/typeDetectionService";
import { FilePublicMagicMetadataProps } from "types/file";
import {
ExtractMetadataResult,
FileTypeInfo,
LivePhotoAssets,
Location,
@ -69,6 +68,11 @@ export const NULL_EXTRACTED_METADATA: ParsedExtractedMetadata = {
height: null,
};
export interface ExtractMetadataResult {
metadata: Metadata;
publicMagicMetadata: FilePublicMagicMetadataProps;
}
export async function extractMetadata(
worker: Remote<DedicatedCryptoWorker>,
receivedFile: File | ElectronFile,

View file

@ -93,14 +93,14 @@ class UploadService {
this.pendingUploadCount--;
}
private async getUploadURL() {
async getUploadURL() {
if (this.uploadURLs.length === 0 && this.pendingUploadCount) {
await this.fetchUploadURLs();
}
return this.uploadURLs.pop();
}
public async preFetchUploadURLs() {
private async preFetchUploadURLs() {
try {
await this.fetchUploadURLs();
// checking for any subscription related errors
@ -819,7 +819,7 @@ const uploadToBucket = async (
);
}
}
const thumbnailUploadURL = await this.getUploadURL();
const thumbnailUploadURL = await uploadService.getUploadURL();
let thumbnailObjectKey: string = null;
if (!isCFUploadProxyDisabled) {
thumbnailObjectKey = await UploadHttpClient.putFileV2(

View file

@ -132,6 +132,7 @@ export interface EncryptedFile {
file: ProcessedFile;
fileKey: B64EncryptionResult;
}
export interface ProcessedFile {
file: LocalFileAttributes<Uint8Array | DataStream>;
thumbnail: LocalFileAttributes<Uint8Array>;
@ -164,8 +165,3 @@ export interface PublicUploadProps {
passwordToken: string;
accessedThroughSharedURL: boolean;
}
export interface ExtractMetadataResult {
metadata: Metadata;
publicMagicMetadata: FilePublicMagicMetadataProps;
}