PeerCastStation.UI.HTTP.APIHost.APIContext.GetChannelConnections C# (CSharp) Method

GetChannelConnections() private method

private GetChannelConnections ( string channelId ) : Newtonsoft.Json.Linq.JArray
channelId string
return Newtonsoft.Json.Linq.JArray
      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);
      }