diff --git a/src/now-playing/goose-now-playing.service.ts b/src/now-playing/goose-now-playing.service.ts index 3091a11..835feab 100644 --- a/src/now-playing/goose-now-playing.service.ts +++ b/src/now-playing/goose-now-playing.service.ts @@ -81,9 +81,17 @@ export class GooseNowPlayingService { this.logger.log(`Goose poll: ${updated}/${stations.length} обновлено`); } + // У большинства каналов mount потока == ключ now-playing API. Исключение: + // Технорейв — поток /listen/harddance/, а в API он /api/nowplaying/technorave. + private readonly slugAliases: Record = { + harddance: 'technorave', + }; + // https://radiogoose.ru/listen/bigroom/play → bigroom private extractSlug(streamUrl: string): string | null { const m = streamUrl.match(/\/listen\/([a-z0-9]+)\/play/i); - return m ? m[1].toLowerCase() : null; + if (!m) return null; + const slug = m[1].toLowerCase(); + return this.slugAliases[slug] ?? slug; } }