mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 01:18:27 +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
|
||||
]);
|
||||
|
||||
const file = new File(
|
||||
[ await storage.res() ],
|
||||
outputName,
|
||||
{ type: output.type }
|
||||
);
|
||||
|
||||
const file = Storage.retype(await storage.res(), output.type);
|
||||
if (file.size === 0) return;
|
||||
|
||||
return file;
|
||||
|
@ -13,3 +13,7 @@ export function init(expectedSize?: number): Promise<AbstractStorage> {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
const file = new File(
|
||||
[ await storage.res() ], '', { type: contentType }
|
||||
);
|
||||
const file = Storage.retype(await storage.res(), contentType);
|
||||
|
||||
if (contentLength && Number(contentLength) !== file.size) {
|
||||
return error("file was not downloaded fully");
|
||||
|
Loading…
Reference in New Issue
Block a user