mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-27 00:41:45 +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 overrides = ['mp3', 'mov'];
|
||||
|
||||
if (canonicalExtension && extensions?.has(canonicalExtension))
|
||||
return canonicalExtension;
|
||||
|
||||
const overrides = ['mp3', 'mov', 'opus'];
|
||||
|
||||
if (!extensions)
|
||||
return;
|
||||
|
|
|
@ -7,7 +7,7 @@ export type FileInfo = {
|
|||
}
|
||||
|
||||
export type RenderParams = {
|
||||
blob: Blob,
|
||||
blob: Blob | File,
|
||||
output?: FileInfo,
|
||||
args: string[],
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue