public IEnumerable <ChannelInfo> GetChannels(CancellationToken cancellationToken) { refreshChannels = true; var channels = GetChannelList(cancellationToken); IEnumerable <Channel> channel = channels.Root.ChannelGroup.SelectMany(c => c.Channel); Plugin.Logger.Info("Found overall channels: {0}", channel.Count()); return(channel.Select((c, index) => { var channelInfo = new ChannelInfo() { Id = c.Id, Name = c.Name, Number = index.ToString(), ChannelType = (GeneralExtensions.HasVideoFlag(c.Flags)) ? ChannelType.TV : ChannelType.Radio, }; if (!String.IsNullOrEmpty(c.Logo)) { channelInfo.ImageUrl = _wssProxy.GetChannelLogo(c); } Plugin.Logger.Info("Found Channel: {0}, Nr: {1}, Id: {2}, EPGId: {3} of Type:{4}, Channel Logo: {5}", c.Name, c.Nr, c.Id, c.EPGID, channelInfo.ChannelType, channelInfo.ImageUrl); return channelInfo; })); }
public async Task <List <ChannelInfo> > GetChannels(string baseUrl, DVBViewerOptions configuration, CancellationToken cancellationToken) { var channels = await GetChannelList(baseUrl, configuration, cancellationToken).ConfigureAwait(false); return(channels.Root.ChannelGroup.SelectMany(c => c.Channel).Select(c => { var channelInfo = new ChannelInfo() { Id = c.Id, Name = c.Name, ChannelType = (GeneralExtensions.HasVideoFlag(c.Flags)) ? ChannelType.TV : ChannelType.Radio, }; if (!String.IsNullOrEmpty(c.Logo)) { channelInfo.ImageUrl = _wssProxy.GetChannelLogo(baseUrl, configuration, c); } return channelInfo; }).ToList()); }