fix(now-playing): ГУСЬ Технорейв — алиас slug harddance→technorave
У этого канала mount потока (harddance) не совпадает с ключом AzuraCast API (technorave). Остальные 15 — совпадают.
This commit is contained in:
@@ -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<string, string> = {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user