From ddf8d007b7a336862b8d1bdd0785ef79f9b4174f Mon Sep 17 00:00:00 2001 From: tapframe Date: Fri, 20 Jun 2025 18:57:41 +0530 Subject: [PATCH] Update progress thresholds across components to 85% for improved user experience This update modifies various components, including ContinueWatchingSection, HeroSection, SeriesContent, and player components, to adjust the progress completion threshold from 95% to 85%. This change ensures that users can continue watching content that is closer to completion, enhancing engagement and usability. Additionally, related logic in the useWatchProgress hook and HomeScreen is updated to reflect this new threshold, providing a consistent experience across the application. --- src/components/home/ContinueWatchingSection.tsx | 4 ++-- src/components/metadata/HeroSection.tsx | 10 +++++----- src/components/metadata/SeriesContent.tsx | 12 ++++++------ src/components/player/AndroidVideoPlayer.tsx | 2 +- src/components/player/VideoPlayer.tsx | 2 +- src/hooks/useWatchProgress.ts | 4 ++-- src/screens/HomeScreen.tsx | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/home/ContinueWatchingSection.tsx b/src/components/home/ContinueWatchingSection.tsx index ba9a8ce44..7aeda06c0 100644 --- a/src/components/home/ContinueWatchingSection.tsx +++ b/src/components/home/ContinueWatchingSection.tsx @@ -100,10 +100,10 @@ const ContinueWatchingSection = React.forwardRef((props, re const episodeId = episodeIdParts.length > 0 ? episodeIdParts.join(':') : undefined; const progress = allProgress[key]; - // Skip items that are more than 95% complete (effectively finished) + // Skip items that are more than 85% complete (effectively finished) const progressPercent = (progress.currentTime / progress.duration) * 100; - if (progressPercent >= 95) { + if (progressPercent >= 85) { continue; } diff --git a/src/components/metadata/HeroSection.tsx b/src/components/metadata/HeroSection.tsx index 2139561ad..80d15ab95 100644 --- a/src/components/metadata/HeroSection.tsx +++ b/src/components/metadata/HeroSection.tsx @@ -332,7 +332,7 @@ const WatchProgressDisplay = React.memo(({ } // Enhanced display text with Trakt integration - let displayText = progressPercent >= 95 ? 'Watched' : `${Math.round(progressPercent)}% watched`; + let displayText = progressPercent >= 85 ? 'Watched' : `${Math.round(progressPercent)}% watched`; let syncStatus = ''; // Show Trakt sync status if user is authenticated @@ -373,7 +373,7 @@ const WatchProgressDisplay = React.memo(({ progressBoxScale.value = withTiming(1, { duration: 400 }); progressBoxTranslateY.value = withTiming(0, { duration: 400 }); - if (progressData.isWatched || (progressData.progressPercent && progressData.progressPercent >= 95)) { + if (progressData.isWatched || (progressData.progressPercent && progressData.progressPercent >= 85)) { // Celebration animation sequence celebrationScale.value = withRepeat( withTiming(1.05, { duration: 200 }), @@ -426,7 +426,7 @@ const WatchProgressDisplay = React.memo(({ if (!progressData) return null; - const isCompleted = progressData.isWatched || progressData.progressPercent >= 95; + const isCompleted = progressData.isWatched || progressData.progressPercent >= 85; return ( @@ -704,7 +704,7 @@ const HeroSection: React.FC = ({ // Memoized play button text const playButtonText = useMemo(() => getPlayButtonText(), [getPlayButtonText]); - // Calculate if content is watched (>=95% progress) - check both local and Trakt progress + // Calculate if content is watched (>=85% progress) - check both local and Trakt progress const isWatched = useMemo(() => { if (!watchProgress) return false; @@ -718,7 +718,7 @@ const HeroSection: React.FC = ({ // Fall back to local progress if (watchProgress.duration === 0) return false; const progressPercent = (watchProgress.currentTime / watchProgress.duration) * 100; - const localWatched = progressPercent >= 95; + const localWatched = progressPercent >= 85; logger.log(`[HeroSection] Local progress: ${progressPercent.toFixed(1)}%, Watched: ${localWatched}`); return localWatched; }, [watchProgress, isTraktAuthenticated]); diff --git a/src/components/metadata/SeriesContent.tsx b/src/components/metadata/SeriesContent.tsx index 82086fd58..5f5feb513 100644 --- a/src/components/metadata/SeriesContent.tsx +++ b/src/components/metadata/SeriesContent.tsx @@ -285,8 +285,8 @@ export const SeriesContent: React.FC = ({ const progress = episodeProgress[episodeId]; const progressPercent = progress ? (progress.currentTime / progress.duration) * 100 : 0; - // Don't show progress bar if episode is complete (>= 95%) - const showProgress = progress && progressPercent < 95; + // Don't show progress bar if episode is complete (>= 85%) + const showProgress = progress && progressPercent < 85; return ( = ({ /> )} - {progressPercent >= 95 && ( + {progressPercent >= 85 && ( @@ -395,8 +395,8 @@ export const SeriesContent: React.FC = ({ const progress = episodeProgress[episodeId]; const progressPercent = progress ? (progress.currentTime / progress.duration) * 100 : 0; - // Don't show progress bar if episode is complete (>= 95%) - const showProgress = progress && progressPercent < 95; + // Don't show progress bar if episode is complete (>= 85%) + const showProgress = progress && progressPercent < 85; return ( = ({ )} {/* Completed Badge */} - {progressPercent >= 95 && ( + {progressPercent >= 85 && ( diff --git a/src/components/player/AndroidVideoPlayer.tsx b/src/components/player/AndroidVideoPlayer.tsx index d54fa18fd..13d5c9650 100644 --- a/src/components/player/AndroidVideoPlayer.tsx +++ b/src/components/player/AndroidVideoPlayer.tsx @@ -268,7 +268,7 @@ const AndroidVideoPlayer: React.FC = () => { const progressPercent = (savedProgress.currentTime / savedProgress.duration) * 100; logger.log(`[AndroidVideoPlayer] Progress: ${progressPercent.toFixed(1)}% (${savedProgress.currentTime}/${savedProgress.duration})`); - if (progressPercent < 95) { + if (progressPercent < 85) { setResumePosition(savedProgress.currentTime); logger.log(`[AndroidVideoPlayer] Set resume position to: ${savedProgress.currentTime}`); diff --git a/src/components/player/VideoPlayer.tsx b/src/components/player/VideoPlayer.tsx index 89cd404ad..f5d285766 100644 --- a/src/components/player/VideoPlayer.tsx +++ b/src/components/player/VideoPlayer.tsx @@ -263,7 +263,7 @@ const VideoPlayer: React.FC = () => { const progressPercent = (savedProgress.currentTime / savedProgress.duration) * 100; logger.log(`[VideoPlayer] Progress: ${progressPercent.toFixed(1)}% (${savedProgress.currentTime}/${savedProgress.duration})`); - if (progressPercent < 95) { + if (progressPercent < 85) { setResumePosition(savedProgress.currentTime); logger.log(`[VideoPlayer] Set resume position to: ${savedProgress.currentTime}`); diff --git a/src/hooks/useWatchProgress.ts b/src/hooks/useWatchProgress.ts index ff47bf497..a4ec9d57e 100644 --- a/src/hooks/useWatchProgress.ts +++ b/src/hooks/useWatchProgress.ts @@ -156,9 +156,9 @@ export const useWatchProgress = ( return 'Play'; } - // Consider episode complete if progress is >= 95% + // Consider episode complete if progress is >= 85% const progressPercent = (watchProgress.currentTime / watchProgress.duration) * 100; - if (progressPercent >= 95) { + if (progressPercent >= 85) { return 'Play'; } diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 850198533..e622643a2 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -666,11 +666,11 @@ const HomeScreen = () => { console.log('[HomeScreen] All watch progress in storage:', Object.keys(allProgress).length, 'items'); console.log('[HomeScreen] Watch progress items:', allProgress); - // Check if any items are being filtered out due to >95% progress + // Check if any items are being filtered out due to >85% progress let filteredCount = 0; for (const [key, progress] of Object.entries(allProgress)) { const progressPercent = (progress.currentTime / progress.duration) * 100; - if (progressPercent >= 95) { + if (progressPercent >= 85) { filteredCount++; console.log(`[HomeScreen] Filtered out ${key}: ${progressPercent.toFixed(1)}% complete`); } else {