Shuffle
This commit is contained in:
parent
5befc53d8c
commit
0da46f3298
3 changed files with 9 additions and 9 deletions
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue