예제 #1
0
        public static async Task <IList <WebProgramDetailed> > ProcessAsync(IOwinContext context, string channelId, DateTime startTime, DateTime endTime)
        {
            if (!ServiceRegistration.IsRegistered <ITvProvider>())
            {
                throw new BadRequestException("GetProgramsDetailedForChannel: ITvProvider not found");
            }

            var programs = await TVAccess.GetChannelProgramsAsync(context, int.Parse(channelId), startTime, endTime);

            if (programs.Count == 0)
            {
                Logger.Warn("GetProgramsDetailedForChannel: Couldn't get Now/Next Info for channel with Id: {0}", channelId);
            }

            return(programs.Select(program => ProgramDetailed(program)).ToList());
        }