1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

autoplay if there is only one embed

This commit is contained in:
mrjvs 2023-10-19 16:33:14 +02:00
parent e1edb1cc1f
commit e939c6b0bd

View file

@ -109,6 +109,18 @@ export function EmbedSelectionView({ sourceId, id }: EmbedSelectionViewProps) {
router.close();
return null;
}
if (result.embeds.length === 1) {
const embedResult = await providers.runEmbedScraper({
id: result.embeds[0].embedId,
url: result.embeds[0].url,
});
setSourceId(sourceId);
setSource(
convertRunoutputToSource({ stream: embedResult.stream }),
progress
);
router.close();
}
return result.embeds;
}, [sourceId, meta, router]);