private JArray GetChannelConnections(string channelId)
{
var channel = GetChannel(channelId);
var res =
channel.SourceStream==null ?
Enumerable.Empty<JObject>() :
Enumerable.Repeat(channel.SourceStream, 1).Select(s => GetChannelConnection(s));
res = res.Concat(channel.OutputStreams.Select(s => GetChannelConnection(s)));
foreach (var yp in PeerCast.YellowPages) {
res = res.Concat(yp.AnnouncingChannels
.Where(ac => ac.Channel.ChannelID==channel.ChannelID)
.Select(s => GetChannelConnection(s)));
}
return new JArray(res);
}