mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +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 {
|
export class TrailerService {
|
||||||
// Cache for 3 minutes — just enough to avoid re-extracting on quick re-renders
|
// Cache for 5 seconds — just enough to avoid re-extracting on quick re-renders
|
||||||
private static readonly CACHE_TTL_MS = 30 * 1000;
|
private static readonly CACHE_TTL_MS = 5 * 1000;
|
||||||
private static urlCache = new Map<string, CacheEntry>();
|
private static urlCache = new Map<string, CacheEntry>();
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
@ -114,6 +114,11 @@ export class TrailerService {
|
||||||
return { url, title, year };
|
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 setUseLocalServer(_useLocal: boolean): void {}
|
||||||
|
|
||||||
static getServerStatus(): { usingLocal: boolean; localUrl: string } {
|
static getServerStatus(): { usingLocal: boolean; localUrl: string } {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue