Fix validatePlayableStream crashing everything

This commit is contained in:
TheTank 2026-02-02 13:36:16 -05:00
parent 9aac094373
commit 6f761c0187

View file

@ -111,13 +111,24 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
// return stream is there are any // return stream is there are any
if (output.stream?.[0]) { if (output.stream?.[0]) {
const playableStream = await validatePlayableStream(output.stream[0], ops, source.id); try {
if (!playableStream) throw new NotFoundError('No streams found'); const playableStream = await validatePlayableStream(output.stream[0], ops, source.id);
if (!playableStream) throw new NotFoundError('No streams found');
return {
sourceId: source.id, return {
stream: playableStream, sourceId: source.id,
}; stream: playableStream,
};
} catch (error) {
const updateParams: UpdateEvent = {
id: source.id,
percentage: 100,
status: error instanceof NotFoundError ? 'notfound' : 'failure',
reason: error instanceof NotFoundError ? error.message : 'Stream validation failed',
error: error instanceof NotFoundError ? undefined : error,
};
ops.events?.update?.(updateParams);
}
} }
// filter disabled and run embed scrapers on listed embeds // filter disabled and run embed scrapers on listed embeds