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,6 +111,7 @@ 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]) {
try {
const playableStream = await validatePlayableStream(output.stream[0], ops, source.id); const playableStream = await validatePlayableStream(output.stream[0], ops, source.id);
if (!playableStream) throw new NotFoundError('No streams found'); if (!playableStream) throw new NotFoundError('No streams found');
@ -118,6 +119,16 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
sourceId: source.id, sourceId: source.id,
stream: playableStream, 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