mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
web/workers: append type to outputted files
This commit is contained in:
parent
f655432376
commit
b6a207a9b0
@ -120,12 +120,7 @@ export default class LibAVWrapper {
|
|||||||
outputName
|
outputName
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const file = new File(
|
const file = Storage.retype(await storage.res(), output.type);
|
||||||
[ await storage.res() ],
|
|
||||||
outputName,
|
|
||||||
{ type: output.type }
|
|
||||||
);
|
|
||||||
|
|
||||||
if (file.size === 0) return;
|
if (file.size === 0) return;
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
|
@ -13,3 +13,7 @@ export function init(expectedSize?: number): Promise<AbstractStorage> {
|
|||||||
|
|
||||||
throw "no storage method is available";
|
throw "no storage method is available";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function retype(file: File, type: string) {
|
||||||
|
return new File([ file ], file.name, { type });
|
||||||
|
}
|
||||||
|
@ -76,9 +76,7 @@ const fetchFile = async (url: string) => {
|
|||||||
return error("tunnel is broken");
|
return error("tunnel is broken");
|
||||||
}
|
}
|
||||||
|
|
||||||
const file = new File(
|
const file = Storage.retype(await storage.res(), contentType);
|
||||||
[ await storage.res() ], '', { type: contentType }
|
|
||||||
);
|
|
||||||
|
|
||||||
if (contentLength && Number(contentLength) !== file.size) {
|
if (contentLength && Number(contentLength) !== file.size) {
|
||||||
return error("file was not downloaded fully");
|
return error("file was not downloaded fully");
|
||||||
|
Loading…
Reference in New Issue
Block a user