fix(now-playing): EMG-поллер не фильтрует по isOnline + чинит ошибочный offline
health-check ошибочно метит HLS-потоки emgsound как offline → поллер их пропускал. Теперь поллим все emgsound-станции и при успешном получении трека ставим isOnline=true. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -34,8 +34,9 @@ export class EmgNowPlayingService {
|
|||||||
|
|
||||||
@Interval(30000)
|
@Interval(30000)
|
||||||
async pollEmgNowPlaying() {
|
async pollEmgNowPlaying() {
|
||||||
|
// Не фильтруем по isOnline: health-check ошибочно метит HLS-потоки offline.
|
||||||
const stations = await this.prisma.station.findMany({
|
const stations = await this.prisma.station.findMany({
|
||||||
where: { isOnline: true, streamUrl: { contains: 'emgsound.ru' } },
|
where: { streamUrl: { contains: 'emgsound.ru' } },
|
||||||
});
|
});
|
||||||
if (stations.length === 0) return;
|
if (stations.length === 0) return;
|
||||||
|
|
||||||
@@ -64,6 +65,13 @@ export class EmgNowPlayingService {
|
|||||||
song: cur.title.trim(),
|
song: cur.title.trim(),
|
||||||
coverUrl: cur.coverImageWebpUrl600 ?? cur.coverImageUrl600 ?? null,
|
coverUrl: cur.coverImageWebpUrl600 ?? cur.coverImageUrl600 ?? null,
|
||||||
});
|
});
|
||||||
|
// Станция явно в эфире — поправим ошибочный offline-флаг
|
||||||
|
if (!station.isOnline) {
|
||||||
|
await this.prisma.station.update({
|
||||||
|
where: { id: station.id },
|
||||||
|
data: { isOnline: true },
|
||||||
|
});
|
||||||
|
}
|
||||||
updated++;
|
updated++;
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user