mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-28 01:08:26 +00:00
web/libav: accept canonical extension if blob is a file
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
This commit is contained in:
parent
c5e7b29c6c
commit
75cda47633
|
@ -56,9 +56,14 @@ export default class LibAVWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static getExtensionFromType(blob: Blob) {
|
static getExtensionFromType(blob: Blob | File) {
|
||||||
|
const canonicalExtension = blob instanceof File && blob.name.split('.').pop()?.toLowerCase();
|
||||||
const extensions = mime.getAllExtensions(blob.type);
|
const extensions = mime.getAllExtensions(blob.type);
|
||||||
const overrides = ['mp3', 'mov'];
|
|
||||||
|
if (canonicalExtension && extensions?.has(canonicalExtension))
|
||||||
|
return canonicalExtension;
|
||||||
|
|
||||||
|
const overrides = ['mp3', 'mov', 'opus'];
|
||||||
|
|
||||||
if (!extensions)
|
if (!extensions)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -7,7 +7,7 @@ export type FileInfo = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RenderParams = {
|
export type RenderParams = {
|
||||||
blob: Blob,
|
blob: Blob | File,
|
||||||
output?: FileInfo,
|
output?: FileInfo,
|
||||||
args: string[],
|
args: string[],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue