public static async Task <IList <WebProgramBasic> > ProcessAsync(IOwinContext context, string channelId) { if (!ServiceRegistration.IsRegistered <ITvProvider>()) { throw new BadRequestException("GetNowNextWebProgramBasicForChannel: ITvProvider not found"); } IChannelAndGroupInfoAsync channelAndGroupInfo = ServiceRegistration.Get <ITvProvider>() as IChannelAndGroupInfoAsync; IProgramInfoAsync programInfo = ServiceRegistration.Get <ITvProvider>() as IProgramInfoAsync; var programs = await TVAccess.GetChannelNowNextProgramAsync(context, int.Parse(channelId)); if (programs == null) { throw new BadRequestException(string.Format("GetNowNextWebProgramBasicForChannel: Couldn't get Now/Next Info for channel with Id: {0}", channelId)); } List <WebProgramBasic> output = new List <WebProgramBasic> { ProgramBasic(programs[0]), ProgramBasic(programs[1]) }; return(output); }
public static async Task <WebProgramDetailed> ProcessAsync(IOwinContext context, string channelId) { if (!ServiceRegistration.IsRegistered <ITvProvider>()) { throw new BadRequestException("GetNextProgramOnChannel: ITvProvider not found"); } var programs = await TVAccess.GetChannelNowNextProgramAsync(context, int.Parse(channelId)); if (programs == null) { throw new NotFoundException(string.Format("GetNextProgramOnChannel: Couldn't get Now/Next Info for channel with Id: {0}", channelId)); } WebProgramDetailed webProgramDetailed = ProgramDetailed(programs[0]); return(webProgramDetailed); }