feat(tv): add 60s background refresh for idle screens

This commit is contained in:
Fredrik Burmester
2026-01-24 10:48:42 +01:00
parent a852e2e769
commit c215fda973
7 changed files with 19 additions and 6 deletions

View File

@@ -293,6 +293,7 @@ export const TVSeriesPage: React.FC<TVSeriesPageProps> = ({
return response.data.Items || [];
},
staleTime: isOffline ? Infinity : 60 * 1000,
refetchInterval: !isOffline ? 60 * 1000 : undefined,
enabled: isOffline || (!!api && !!user?.Id && !!item.Id),
});
@@ -345,7 +346,8 @@ export const TVSeriesPage: React.FC<TVSeriesPageProps> = ({
});
return res.data.Items || [];
},
staleTime: isOffline ? Infinity : 0,
staleTime: isOffline ? Infinity : 60 * 1000,
refetchInterval: !isOffline ? 60 * 1000 : undefined,
enabled: isOffline
? !!item.Id && selectedSeasonNumber !== null
: !!api && !!user?.Id && !!item.Id && !!selectedSeasonId,