From 25ae949995e4726aec79f35b7e6707b18d63758a Mon Sep 17 00:00:00 2001 From: William Oldham Date: Tue, 23 Jan 2024 21:44:53 +0000 Subject: [PATCH] Check for extension in scrape logic --- src/components/player/hooks/useSourceSelection.ts | 6 +++--- src/hooks/useProviderScrape.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/player/hooks/useSourceSelection.ts b/src/components/player/hooks/useSourceSelection.ts index 3813fa9f..a7f06b4d 100644 --- a/src/components/player/hooks/useSourceSelection.ts +++ b/src/components/player/hooks/useSourceSelection.ts @@ -42,7 +42,7 @@ export function useEmbedScraping( let result: EmbedOutput | undefined; if (!meta) return; try { - if (providerApiUrl) { + if (providerApiUrl && !isExtensionActiveCached()) { const baseUrlMaker = makeProviderUrl(providerApiUrl); const conn = await connectServerSideEvents( baseUrlMaker.scrapeEmbed(embedId, url), @@ -107,7 +107,7 @@ export function useSourceScraping(sourceId: string | null, routerId: string) { let result: SourcererOutput | undefined; try { - if (providerApiUrl) { + if (providerApiUrl && !isExtensionActiveCached()) { const baseUrlMaker = makeProviderUrl(providerApiUrl); const conn = await connectServerSideEvents( baseUrlMaker.scrapeSource(sourceId, scrapeMedia), @@ -149,7 +149,7 @@ export function useSourceScraping(sourceId: string | null, routerId: string) { let embedResult: EmbedOutput | undefined; if (!meta) return; try { - if (providerApiUrl) { + if (providerApiUrl && !isExtensionActiveCached()) { const baseUrlMaker = makeProviderUrl(providerApiUrl); const conn = await connectServerSideEvents( baseUrlMaker.scrapeEmbed( diff --git a/src/hooks/useProviderScrape.tsx b/src/hooks/useProviderScrape.tsx index 84aeec4e..932c8449 100644 --- a/src/hooks/useProviderScrape.tsx +++ b/src/hooks/useProviderScrape.tsx @@ -159,7 +159,7 @@ export function useScrape() { const startScraping = useCallback( async (media: ScrapeMedia) => { const providerApiUrl = getLoadbalancedProviderApiUrl(); - if (providerApiUrl) { + if (providerApiUrl && !isExtensionActiveCached()) { startScrape(); const baseUrlMaker = makeProviderUrl(providerApiUrl); const conn = await connectServerSideEvents(