From 499863744f20c3952ce897f40216d9aeb742b779 Mon Sep 17 00:00:00 2001 From: nk Date: Wed, 3 Jun 2026 15:34:05 +0300 Subject: [PATCH] =?UTF-8?q?fix(now-playing):=20EMG-=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BB=D0=B5=D1=80=20=D0=BD=D0=B5=20=D1=84=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=B5=D1=82=20=D0=BF=D0=BE=20isOnline=20+=20?= =?UTF-8?q?=D1=87=D0=B8=D0=BD=D0=B8=D1=82=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE?= =?UTF-8?q?=D1=87=D0=BD=D1=8B=D0=B9=20offline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit health-check ошибочно метит HLS-потоки emgsound как offline → поллер их пропускал. Теперь поллим все emgsound-станции и при успешном получении трека ставим isOnline=true. Co-Authored-By: Claude Opus 4.8 --- src/now-playing/emg-now-playing.service.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/now-playing/emg-now-playing.service.ts b/src/now-playing/emg-now-playing.service.ts index 0caaefb..740cf24 100644 --- a/src/now-playing/emg-now-playing.service.ts +++ b/src/now-playing/emg-now-playing.service.ts @@ -34,8 +34,9 @@ export class EmgNowPlayingService { @Interval(30000) async pollEmgNowPlaying() { + // Не фильтруем по isOnline: health-check ошибочно метит HLS-потоки offline. const stations = await this.prisma.station.findMany({ - where: { isOnline: true, streamUrl: { contains: 'emgsound.ru' } }, + where: { streamUrl: { contains: 'emgsound.ru' } }, }); if (stations.length === 0) return; @@ -64,6 +65,13 @@ export class EmgNowPlayingService { song: cur.title.trim(), coverUrl: cur.coverImageWebpUrl600 ?? cur.coverImageUrl600 ?? null, }); + // Станция явно в эфире — поправим ошибочный offline-флаг + if (!station.isOnline) { + await this.prisma.station.update({ + where: { id: station.id }, + data: { isOnline: true }, + }); + } updated++; }), );