fix: metadata extraction for media streams with unknown profile (#32023)
This commit is contained in:
@@ -483,7 +483,9 @@ export class MediaRepository {
|
||||
}
|
||||
|
||||
private parseEnum<E extends Record<string, number | string>>(enumObj: E, value?: string) {
|
||||
return value ? ((enumObj[pascalCase(value)] as Extract<E[keyof E], number> | undefined) ?? null) : null;
|
||||
return value && typeof value === 'string'
|
||||
? ((enumObj[pascalCase(value)] as Extract<E[keyof E], number> | undefined) ?? null)
|
||||
: null;
|
||||
}
|
||||
|
||||
/** Parse a rational like "60000/1001" or "1/600" into `{ num, den }`. */
|
||||
|
||||
Reference in New Issue
Block a user