From 588857a73e3b10250f8759dc8794109e8034797a Mon Sep 17 00:00:00 2001 From: nk Date: Wed, 3 Jun 2026 20:36:48 +0300 Subject: [PATCH] =?UTF-8?q?feat(now-playing):=20MAXIMUM=20=D1=87=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B7=20=D1=82=D0=BE=D1=82=20=D0=B6=D0=B5=20=D0=9A?= =?UTF-8?q?=D1=80=D1=83=D1=82=D0=BE=D0=B9-API=20(dfm.ru/api/n/current)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MAXIMUM — сеть Крутой Медиа, её каналы в том же /api/n/current. Поллер расширен на genre IN (DFM, MAXIMUM) + алиасы (maxbritpop, max80, maximum90, rockhits и т.д.). ICY исключает MAXIMUM. Co-Authored-By: Claude Opus 4.8 --- src/now-playing/dfm-now-playing.service.ts | 19 +++++++++++++++++-- src/now-playing/icy-now-playing.service.ts | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/now-playing/dfm-now-playing.service.ts b/src/now-playing/dfm-now-playing.service.ts index 8343cf6..1d0e28c 100644 --- a/src/now-playing/dfm-now-playing.service.ts +++ b/src/now-playing/dfm-now-playing.service.ts @@ -39,6 +39,20 @@ export class DfmNowPlayingService { игромания: '61-igromaniq', 'vocal-trance': 'trance', 'disco-90th': 'diskach-90h', + // MAXIMUM (тот же Крутой Медиа, тот же /api/n/current) + britpop: '130-maxbritpop', + covers: '129-maxcover', + 'heavy-80-s': '131-max80', + 'heavy-monday': '141-heavymonday', + 'maximum-90th': '145-maximum90', + millenium: '140-millenium', + 'new-russians': '125-maxnewrussians', + punk: '132-maxpunk', + rhcp: '123-maxrhcp', + 'rock-hits': '144-rockhits', + rugby: '139-rugby', + 'russian-rock': '90-russkijrok', + soft: '127-maxsoft', }; constructor( @@ -48,8 +62,9 @@ export class DfmNowPlayingService { @Interval(30000) async pollDfmNowPlaying() { + // DFM и MAXIMUM — обе сети Крутой Медиа, общий API dfm.ru/api/n/current const stations = await this.prisma.station.findMany({ - where: { genre: 'DFM' }, + where: { genre: { in: ['DFM', 'MAXIMUM'] } }, }); if (stations.length === 0) return; @@ -109,7 +124,7 @@ export class DfmNowPlayingService { updated++; } - this.logger.log(`DFM poll: ${updated}/${stations.length} обновлено`); + this.logger.log(`Krutoy poll: ${updated}/${stations.length} обновлено`); } private norm(s: string): string { diff --git a/src/now-playing/icy-now-playing.service.ts b/src/now-playing/icy-now-playing.service.ts index c97531b..b4de699 100644 --- a/src/now-playing/icy-now-playing.service.ts +++ b/src/now-playing/icy-now-playing.service.ts @@ -29,7 +29,7 @@ export class IcyNowPlayingService { const where = { recordStationId: null, isOnline: true, - genre: { notIn: ['DFM', 'Love Radio'] }, + genre: { notIn: ['DFM', 'MAXIMUM', 'Love Radio'] }, NOT: { streamUrl: { contains: 'emgsound.ru' } }, }; const total = await this.prisma.station.count({ where });