mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +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) {
|
if (retryCount < 2) {
|
||||||
logger.info('TrailerModal', `Re-extracting trailer (attempt ${retryCount + 1}/2)`);
|
logger.info('TrailerModal', `Re-extracting trailer (attempt ${retryCount + 1}/2)`);
|
||||||
setRetryCount(prev => prev + 1);
|
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();
|
loadTrailer();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -170,7 +171,7 @@ const TrailerModal: React.FC<TrailerModalProps> = memo(({
|
||||||
logger.error('TrailerModal', 'Video error after retries:', error);
|
logger.error('TrailerModal', 'Video error after retries:', error);
|
||||||
setError('Unable to play trailer. Please try again.');
|
setError('Unable to play trailer. Please try again.');
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}, [retryCount, loadTrailer]);
|
}, [retryCount, loadTrailer, trailer?.key]);
|
||||||
|
|
||||||
const handleTrailerEnd = useCallback(() => {
|
const handleTrailerEnd = useCallback(() => {
|
||||||
setIsPlaying(false);
|
setIsPlaying(false);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue