public async Task<ChannelItemResult> GetTVChannels(CancellationToken cancellationToken) { var data = new Data(); var channels = data.Channels; // Add more items here. var items = new List<ChannelItemInfo>(); foreach (var c in channels) { items.Add(CreateMenu(c.title, "channel", c.id, c.thumb)); } return new ChannelItemResult { Items = items.ToList() }; }
public async Task<ChannelItemResult> GetCategories(String channelID, String thumb, CancellationToken cancellationToken) { var data = new Data(); var categories = data.Categories; // Add more items here. var items = new List<ChannelItemInfo>(); foreach (var c in categories) { items.Add(CreateMenu(c.title, "category", c.id + "_" + channelID, thumb)); } return new ChannelItemResult { Items = items.ToList() }; }
public async Task<ChannelItemResult> GetCategory(String categoryID, String channelID, CancellationToken cancellationToken) { var items = new List<ChannelItemInfo>(); var data = new Data(); var categories = data.Categories; var category = categories.Find(i => i.id == categoryID); if (channelID != "") { // return videos } else { items.Add(CreateMenu(category.title + " Highlights", "video", category.highlights_url())); items.Add(CreateMenu(category.title + " Popular", "video", category.popular_url())); items.Add(CreateMenu("All programmes", "video", feedURL + "/iplayer/highlights/tv")); foreach (var subCat in category.subCategories) { _logger.Debug("URL : " + category.subcategory_url(subCat.id)); items.Add(CreateMenu(subCat.title, "video", category.subcategory_url(subCat.id))); } } return new ChannelItemResult { Items = items.ToList() }; }