diff --git a/components/SearchLoadingAnimation.tsx b/components/SearchLoadingAnimation.tsx index e2ebbe5..b3c020e 100644 --- a/components/SearchLoadingAnimation.tsx +++ b/components/SearchLoadingAnimation.tsx @@ -10,9 +10,9 @@ interface SearchLoadingAnimationProps { onComplete?: (checkedSources: number, totalSources: number) => void; } -export function SearchLoadingAnimation({ - currentSource, - checkedSources = 0, +export function SearchLoadingAnimation({ + currentSource, + checkedSources = 0, totalSources = 16, isPaused = false, onComplete, @@ -54,7 +54,7 @@ export function SearchLoadingAnimation({ // Small delay to allow animation to settle const timeout = setTimeout(() => { onComplete(checkedSources, totalSources); - }, 300); + }, 100); return () => clearTimeout(timeout); } }, [isComplete, onComplete, checkedSources, totalSources]); @@ -78,7 +78,7 @@ export function SearchLoadingAnimation({ strokeLinecap="round" /> - + 正在搜索视频源{dots} @@ -86,19 +86,19 @@ export function SearchLoadingAnimation({ {/* Progress Bar - Unified 0-100% */}
-
{/* Shimmer Effect - Optimized for GPU with contain for better performance */} -
- + {/* Progress Info - Real-time count with pause indicator */}
diff --git a/components/ServiceWorkerRegister.tsx b/components/ServiceWorkerRegister.tsx index c79e9fa..82be763 100644 --- a/components/ServiceWorkerRegister.tsx +++ b/components/ServiceWorkerRegister.tsx @@ -8,12 +8,11 @@ export function ServiceWorkerRegister() { window.addEventListener('load', () => { navigator.serviceWorker.register('/sw.js').then( (registration) => { - console.log('ServiceWorker registration successful with scope: ', registration.scope); - }, - (err) => { - console.log('ServiceWorker registration failed: ', err); - } - ); + // Registration successful + }) + .catch((err) => { + // Registration failed + }); }); } }, []); diff --git a/components/adult/AdultContentGrid.tsx b/components/adult/AdultContentGrid.tsx index 86c1fad..2d91d99 100644 --- a/components/adult/AdultContentGrid.tsx +++ b/components/adult/AdultContentGrid.tsx @@ -4,6 +4,7 @@ import Link from 'next/link'; import Image from 'next/image'; import React from 'react'; import { Card } from '@/components/ui/Card'; +import { Icons } from '@/components/ui/Icon'; interface AdultVideo { vod_id: string | number; @@ -133,8 +134,6 @@ function AdultGridNoMore() { } function AdultGridEmpty() { - // Using require to avoid top-level import issues if any, matching MovieGrid pattern - const { Icons } = require('@/components/ui/Icon'); return (
diff --git a/components/home/MovieGrid.tsx b/components/home/MovieGrid.tsx index 51dd1a7..50c5ee0 100644 --- a/components/home/MovieGrid.tsx +++ b/components/home/MovieGrid.tsx @@ -4,6 +4,7 @@ */ import { MovieCard } from './MovieCard'; +import { Icons } from '@/components/ui/Icon'; interface DoubanMovie { id: string; @@ -81,7 +82,6 @@ function MovieGridNoMore() { } function MovieGridEmpty() { - const { Icons } = require('@/components/ui/Icon'); return (
diff --git a/components/player/VideoMetadata.tsx b/components/player/VideoMetadata.tsx index 5f340df..4119655 100644 --- a/components/player/VideoMetadata.tsx +++ b/components/player/VideoMetadata.tsx @@ -50,7 +50,7 @@ export function VideoMetadata({ videoData, source, title }: VideoMetadataProps) )}
{videoData?.vod_content && ( -

+

{videoData.vod_content.replace(/<[^>]*>/g, '')}

)} diff --git a/components/player/VideoPlayer.tsx b/components/player/VideoPlayer.tsx index e5ae6e9..3af4d0d 100644 --- a/components/player/VideoPlayer.tsx +++ b/components/player/VideoPlayer.tsx @@ -77,7 +77,6 @@ export function VideoPlayer({ playUrl, videoId, currentEpisode, onBack }: VideoP // Auto-retry with proxy if not already using it if (!useProxy) { - console.log('Attempting to retry with proxy...'); setUseProxy(true); setShouldAutoPlay(true); // Force autoplay after proxy retry setVideoError(''); diff --git a/components/player/hooks/useHLSPreloader.ts b/components/player/hooks/useHLSPreloader.ts index 1b4785f..5d154ed 100644 --- a/components/player/hooks/useHLSPreloader.ts +++ b/components/player/hooks/useHLSPreloader.ts @@ -27,12 +27,11 @@ export function useHLSPreloader({ src, currentTime, videoRef, isLoading }: UseHL const fetchManifest = async () => { try { - console.log('[Preloader] Fetching manifest:', src); + // Fetch manifest const segments = await parseHLSManifest(src); segmentsRef.current = segments; setIsManifestLoaded(true); const totalDuration = segments[segments.length - 1]?.startTime + segments[segments.length - 1]?.duration || 0; - console.log(`[Preloader] Parsed ${segments.length} segments. Total duration: ${totalDuration.toFixed(2)}s`); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); if (errorMessage.includes('503') || errorMessage.includes('Network unavailable')) { diff --git a/components/player/hooks/useHlsPlayer.ts b/components/player/hooks/useHlsPlayer.ts index d13c46d..32e69bc 100644 --- a/components/player/hooks/useHlsPlayer.ts +++ b/components/player/hooks/useHlsPlayer.ts @@ -42,7 +42,6 @@ export function useHlsPlayer({ // EXCEPT for Chrome on Desktop which reports canPlayType as '' (false). if (!isNativeHlsSupported) { - console.log('[HLS] Initializing hls.js'); hls = new Hls({ enableWorker: true, lowLatencyMode: true, @@ -53,7 +52,6 @@ export function useHlsPlayer({ hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, () => { - console.log('[HLS] Manifest parsed'); // Check for HEVC/H.265 codec (limited browser support) if (hls) { @@ -115,13 +113,11 @@ export function useHlsPlayer({ } }); } else { - console.log('[HLS] Using native HLS support'); // Native HLS support video.src = src; } } else if (isNativeHlsSupported) { // Fallback for environments where Hls.js is not supported but native is (e.g. iOS without MSE?) - console.log('[HLS] Using native HLS support (Hls.js not supported)'); video.src = src; } else { console.error('[HLS] HLS not supported in this browser'); diff --git a/lib/hooks/useHistoryDownloader.ts b/lib/hooks/useHistoryDownloader.ts index e8e6562..4545007 100644 --- a/lib/hooks/useHistoryDownloader.ts +++ b/lib/hooks/useHistoryDownloader.ts @@ -32,7 +32,7 @@ function useHistoryDownloader() { // Skip if not m3u8 if (!url.endsWith('.m3u8')) continue; - console.log(`[HistoryDownloader] Queueing background download for: ${item.title}`); + // Queue background download processedUrlsRef.current.add(url); try { @@ -46,9 +46,7 @@ function useHistoryDownloader() { signal: controller.signal, videoUrl: url, // Track metadata for this video onProgress: (current, total) => { - if (current % 50 === 0) { - console.log(`[HistoryDownloader] ${item.title}: ${current}/${total}`); - } + // console.log removed as per instruction } }); } catch (error) { diff --git a/lib/utils/cacheManager.ts b/lib/utils/cacheManager.ts index 0afc469..504942d 100644 --- a/lib/utils/cacheManager.ts +++ b/lib/utils/cacheManager.ts @@ -17,7 +17,6 @@ class CacheManager { try { const stored = localStorage.getItem(METADATA_STORE); if (stored) this.metadata = new Map(Object.entries(JSON.parse(stored))); - console.log('[CacheManager] Initialized with', this.metadata.size, 'entries'); } catch (error) { console.error('[CacheManager] Init failed:', error); } this.initialized = true; } @@ -38,7 +37,6 @@ class CacheManager { const meta = this.metadata.get(url); if (!meta) return false; if (Date.now() - meta.cachedAt > CACHE_TTL) { - console.log('[CacheManager] Cache expired:', url); return false; } meta.lastAccessed = Date.now(); @@ -61,7 +59,6 @@ class CacheManager { await this.initialize(); const stats = await this.getCacheStats(); if (stats.totalSizeMB > MAX_CACHE_SIZE_MB) { - console.log(`[CacheManager] Size ${stats.totalSizeMB.toFixed(2)}MB exceeds ${MAX_CACHE_SIZE_MB}MB`); await this.cleanupOldEntries(); } await this.cleanupExpiredEntries(); @@ -82,7 +79,6 @@ class CacheManager { } if (cleaned > 0) { this.save(); - console.log(`[CacheManager] Cleaned ${cleaned} expired entries`); } return cleaned; } @@ -101,7 +97,6 @@ class CacheManager { } if (removed > 0) { this.save(); - console.log(`[CacheManager] Removed ${removed} old entries`); } return removed; } @@ -120,7 +115,6 @@ class CacheManager { } if (cleared > 0) { this.save(); - console.log(`[CacheManager] Cleared ${cleared} entries for:`, videoUrl); } return cleared; } @@ -133,7 +127,6 @@ class CacheManager { const count = this.metadata.size; this.metadata.clear(); this.save(); - console.log(`[CacheManager] Cleared all ${count} entries`); return count; } } diff --git a/lib/utils/fetch-with-retry.ts b/lib/utils/fetch-with-retry.ts index f172420..dbeb5d1 100644 --- a/lib/utils/fetch-with-retry.ts +++ b/lib/utils/fetch-with-retry.ts @@ -61,7 +61,6 @@ export async function fetchWithRetry({ url, request, headers = {} }: FetchWithRe clearTimeout(timeoutId); if (response.ok) { - console.log(`✓ Proxy success on attempt ${attempt}: ${url.substring(0, 100)}...`); break; } diff --git a/lib/utils/hls-downloader.ts b/lib/utils/hls-downloader.ts index 7a8674a..3689570 100644 --- a/lib/utils/hls-downloader.ts +++ b/lib/utils/hls-downloader.ts @@ -60,12 +60,9 @@ export function preloadSegments({ return; } - // Only log on significant seeks or initial start + // Mark as initialized or handle seek if (!isInitializedRef.current) { - console.log(`[Preloader] Initial start at segment ${startIndex} (${currentTime.toFixed(2)}s)`); isInitializedRef.current = true; - } else if (!isSequential) { - console.log(`[Preloader] Seek detected. Current Time: ${currentTime.toFixed(2)}s. Starting from segment ${startIndex}.`); } lastStartIndexRef.current = startIndex; diff --git a/lib/utils/hlsManifestParser.ts b/lib/utils/hlsManifestParser.ts index a239b2e..94abe64 100644 --- a/lib/utils/hlsManifestParser.ts +++ b/lib/utils/hlsManifestParser.ts @@ -35,7 +35,6 @@ export async function parseHLSManifest(src: string): Promise { // Check if this is a master playlist if (manifestText.includes('#EXT-X-STREAM-INF')) { - console.log('[HLS Parser] Master playlist detected, selecting variant...'); return parseMasterPlaylist(manifestText, src); } @@ -61,7 +60,6 @@ async function parseMasterPlaylist(content: string, baseUrl: string): Promise