mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 09:35:42 +00:00
minor fix to invalidate cache logic
This commit is contained in:
parent
a64d5ac910
commit
6e7a121be0
1 changed files with 7 additions and 2 deletions
|
|
@ -14,8 +14,8 @@ interface CacheEntry {
|
|||
}
|
||||
|
||||
export class TrailerService {
|
||||
// Cache for 3 minutes — just enough to avoid re-extracting on quick re-renders
|
||||
private static readonly CACHE_TTL_MS = 30 * 1000;
|
||||
// Cache for 5 seconds — just enough to avoid re-extracting on quick re-renders
|
||||
private static readonly CACHE_TTL_MS = 5 * 1000;
|
||||
private static urlCache = new Map<string, CacheEntry>();
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -114,6 +114,11 @@ export class TrailerService {
|
|||
return { url, title, year };
|
||||
}
|
||||
|
||||
static invalidateCache(videoId: string): void {
|
||||
this.urlCache.delete(videoId);
|
||||
logger.info('TrailerService', `Cache invalidated for videoId=${videoId}`);
|
||||
}
|
||||
|
||||
static setUseLocalServer(_useLocal: boolean): void {}
|
||||
|
||||
static getServerStatus(): { usingLocal: boolean; localUrl: string } {
|
||||
|
|
|
|||
Loading…
Reference in a new issue