From 28752791ae40a05b55cf3e95bb7696246ec855ca Mon Sep 17 00:00:00 2001 From: tapframe Date: Mon, 8 Sep 2025 02:32:28 +0530 Subject: [PATCH] update beta 10 --- App.tsx | 8 ++--- local-scrapers-repo | 2 +- src/components/metadata/HeroSection.tsx | 3 -- src/screens/PluginsScreen.tsx | 33 ++++++++++++-------- src/services/localScraperService.ts | 12 +++++--- src/services/updateService.ts | 41 ++++++------------------- 6 files changed, 43 insertions(+), 56 deletions(-) diff --git a/App.tsx b/App.tsx index f5e30c39..ca88199a 100644 --- a/App.tsx +++ b/App.tsx @@ -40,10 +40,10 @@ Sentry.init({ // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/ sendDefaultPii: true, - // Configure Session Replay (disabled for performance) - replaysSessionSampleRate: 0, - replaysOnErrorSampleRate: 0, - integrations: [Sentry.feedbackIntegration()], + // Configure Session Replay + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1, + integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()], // uncomment the line below to enable Spotlight (https://spotlightjs.com) // spotlight: __DEV__, diff --git a/local-scrapers-repo b/local-scrapers-repo index 6fda05ee..5c3e2d8b 160000 --- a/local-scrapers-repo +++ b/local-scrapers-repo @@ -1 +1 @@ -Subproject commit 6fda05ee03e39bd6bd1ee9d15be00cb33b491574 +Subproject commit 5c3e2d8bccf7d076e392fdc397233f392e2a1563 diff --git a/src/components/metadata/HeroSection.tsx b/src/components/metadata/HeroSection.tsx index 16e15545..33e7d9c2 100644 --- a/src/components/metadata/HeroSection.tsx +++ b/src/components/metadata/HeroSection.tsx @@ -41,7 +41,6 @@ const { width, height } = Dimensions.get('window'); const isTablet = width >= 768; // Ultra-optimized animation constants -const PARALLAX_FACTOR = 0.3; const SCALE_FACTOR = 1.02; const FADE_THRESHOLD = 200; @@ -933,13 +932,11 @@ const HeroSection: React.FC = memo(({ // Enhanced backdrop with smooth loading animation const backdropImageStyle = useAnimatedStyle(() => { 'worklet'; - const translateY = scrollY.value * PARALLAX_FACTOR; const scale = 1 + (scrollY.value * 0.0001); // Micro scale effect return { opacity: imageOpacity.value * imageLoadOpacity.value, transform: [ - { translateY: -Math.min(translateY, 100) }, // Cap translation { scale: Math.min(scale, SCALE_FACTOR) } // Cap scale ], }; diff --git a/src/screens/PluginsScreen.tsx b/src/screens/PluginsScreen.tsx index c8c3128a..fc0e0d8d 100644 --- a/src/screens/PluginsScreen.tsx +++ b/src/screens/PluginsScreen.tsx @@ -900,9 +900,17 @@ const PluginsScreen: React.FC = () => { const repo = repositories.find(r => r.id === repoId); if (!repo) return; + // Special handling for the last repository + const isLastRepository = repositories.length === 1; + + const alertTitle = isLastRepository ? 'Remove Last Repository' : 'Remove Repository'; + const alertMessage = isLastRepository + ? `Are you sure you want to remove "${repo.name}"? This is your only repository, so you'll have no scrapers available until you add a new repository.` + : `Are you sure you want to remove "${repo.name}"? This will also remove all scrapers from this repository.`; + Alert.alert( - 'Remove Repository', - `Are you sure you want to remove "${repo.name}"? This will also remove all scrapers from this repository.`, + alertTitle, + alertMessage, [ { text: 'Cancel', style: 'cancel' }, { @@ -913,7 +921,10 @@ const PluginsScreen: React.FC = () => { await localScraperService.removeRepository(repoId); await loadRepositories(); await loadScrapers(); - Alert.alert('Success', 'Repository removed successfully'); + const successMessage = isLastRepository + ? 'Repository removed successfully. You can add a new repository using the "Add Repository" button.' + : 'Repository removed successfully'; + Alert.alert('Success', successMessage); } catch (error) { logger.error('[ScraperSettings] Failed to remove repository:', error); Alert.alert('Error', error instanceof Error ? error.message : 'Failed to remove repository'); @@ -1312,15 +1323,13 @@ const PluginsScreen: React.FC = () => { Refresh )} - {repositories.length > 1 && ( - handleRemoveRepository(repo.id)} - disabled={switchingRepository !== null} - > - Remove - - )} + handleRemoveRepository(repo.id)} + disabled={switchingRepository !== null} + > + Remove + ))} diff --git a/src/services/localScraperService.ts b/src/services/localScraperService.ts index 02c3da78..98113123 100644 --- a/src/services/localScraperService.ts +++ b/src/services/localScraperService.ts @@ -415,16 +415,18 @@ class LocalScraperService { throw new Error(`Repository with id ${id} not found`); } - // Don't allow removing the last repository - if (this.repositories.size <= 1) { - throw new Error('Cannot remove the last repository'); - } + // Allow removing the last repository - users can add new ones + // The app will work without repositories (no scrapers available) - // If removing current repository, switch to another one + // If removing current repository, switch to another one or clear current if (id === this.currentRepositoryId) { const remainingRepos = Array.from(this.repositories.values()).filter(r => r.id !== id); if (remainingRepos.length > 0) { await this.setCurrentRepository(remainingRepos[0].id); + } else { + // No repositories left, clear current repository + this.currentRepositoryId = ''; + await AsyncStorage.removeItem('current-repository-id'); } } diff --git a/src/services/updateService.ts b/src/services/updateService.ts index 1cedbba2..ef3d3f16 100644 --- a/src/services/updateService.ts +++ b/src/services/updateService.ts @@ -11,7 +11,7 @@ export interface UpdateInfo { export class UpdateService { private static instance: UpdateService; private updateCheckInterval: NodeJS.Timeout | null = null; - private readonly CHECK_INTERVAL = 5 * 60 * 1000; // 5 minutes + // Removed automatic periodic checks - only check on app start and manual trigger private logs: string[] = []; private readonly MAX_LOGS = 100; // Keep last 100 logs @@ -233,10 +233,7 @@ export class UpdateService { return; } - this.addLog('Updates are enabled, setting up periodic checks', 'INFO'); - - // Set up periodic update checks - this.startPeriodicUpdateChecks(); + this.addLog('Updates are enabled, skipping automatic periodic checks', 'INFO'); this.addLog('UpdateService initialization completed successfully', 'INFO'); } catch (error) { this.addLog(`Initialization failed: ${error instanceof Error ? error.message : String(error)}`, 'ERROR'); @@ -408,39 +405,21 @@ export class UpdateService { } /** - * Start periodic update checks + * Start periodic update checks - DISABLED + * Updates are now only checked on app start and manual trigger */ private startPeriodicUpdateChecks(): void { - if (this.updateCheckInterval) { - this.addLog('Stopping existing periodic update checks', 'INFO'); - clearInterval(this.updateCheckInterval); - } - - this.addLog(`Starting periodic update checks every ${this.CHECK_INTERVAL / 1000} seconds`, 'INFO'); - - this.updateCheckInterval = setInterval(async () => { - try { - this.addLog('Performing scheduled update check...', 'INFO'); - await this.checkForUpdates(); - } catch (error) { - const errorMessage = error instanceof Error ? error.message : String(error); - this.addLog(`Scheduled update check failed: ${errorMessage}`, 'ERROR'); - console.error('Periodic update check failed:', error); - } - }, this.CHECK_INTERVAL); + this.addLog('Periodic update checks are disabled - only checking on app start and manual trigger', 'INFO'); + // Method kept for compatibility but no longer starts automatic checks } /** - * Stop periodic update checks + * Stop periodic update checks - DISABLED + * No periodic checks are running, so this is a no-op */ public stopPeriodicUpdateChecks(): void { - if (this.updateCheckInterval) { - this.addLog('Stopping periodic update checks', 'INFO'); - clearInterval(this.updateCheckInterval); - this.updateCheckInterval = null; - } else { - this.addLog('No periodic update checks running to stop', 'INFO'); - } + this.addLog('Periodic update checks are disabled - nothing to stop', 'INFO'); + // Method kept for compatibility but no longer stops automatic checks } /**