mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 09:35:42 +00:00
fix invalidate cache logic
This commit is contained in:
parent
21e5035c97
commit
a64d5ac910
1 changed files with 3 additions and 2 deletions
|
|
@ -162,7 +162,8 @@ const TrailerModal: React.FC<TrailerModalProps> = memo(({
|
|||
if (retryCount < 2) {
|
||||
logger.info('TrailerModal', `Re-extracting trailer (attempt ${retryCount + 1}/2)`);
|
||||
setRetryCount(prev => prev + 1);
|
||||
// Re-run full extraction — don't reload the same bad URL
|
||||
// Invalidate cache so loadTrailer gets a fresh URL, not the same bad one
|
||||
if (trailer?.key) TrailerService.invalidateCache(trailer.key);
|
||||
loadTrailer();
|
||||
return;
|
||||
}
|
||||
|
|
@ -170,7 +171,7 @@ const TrailerModal: React.FC<TrailerModalProps> = memo(({
|
|||
logger.error('TrailerModal', 'Video error after retries:', error);
|
||||
setError('Unable to play trailer. Please try again.');
|
||||
setLoading(false);
|
||||
}, [retryCount, loadTrailer]);
|
||||
}, [retryCount, loadTrailer, trailer?.key]);
|
||||
|
||||
const handleTrailerEnd = useCallback(() => {
|
||||
setIsPlaying(false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue