From 419ec65cc691d4c25059f32311832a7a1f45df3c Mon Sep 17 00:00:00 2001 From: Darius Date: Thu, 5 Feb 2026 23:41:45 +0100 Subject: [PATCH] remove song end poll --- src/homepage/service.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/homepage/service.ts b/src/homepage/service.ts index 2b582ec..f77380e 100644 --- a/src/homepage/service.ts +++ b/src/homepage/service.ts @@ -94,36 +94,9 @@ export class HomepageService extends BaseService { } this.lastPoll = newPoll; - this.scheduleSongEndPoll(newPoll.tidal_current); return newPoll; } - private scheduleSongEndPoll(tidal: TidalGetCurrent | null): void { - this.clearSongEndPoll(); - - if (!tidal || tidal.status === "paused") { - return; - } - - const remainingSeconds = tidal.durationInSeconds - tidal.currentInSeconds; - if (remainingSeconds > 0) { - this.songEndTimeout = setTimeout( - () => { - this.songEndTimeout = null; - this.getFullInformation(); - }, - (remainingSeconds + 1) * 1000, - ); - } - } - - private clearSongEndPoll(): void { - if (this.songEndTimeout) { - clearTimeout(this.songEndTimeout); - this.songEndTimeout = null; - } - } - listenForClientChange(): void { this.sseService.onClientChange((clientChange: SseClientChangeEvent) => { if (clientChange.clientCount === 0) { @@ -149,6 +122,5 @@ export class HomepageService extends BaseService { if (this.pollingInterval) { clearInterval(this.pollingInterval); } - this.clearSongEndPoll(); } }