public async Task <IEnumerable <ProgramInfo> > GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) { var epgData = await _tvGuide.getTvGuideForChannel(channelId, startDateUtc, endDateUtc, cancellationToken); var programInfos = epgData.ToList(); if (!programInfos.Any()) { _logger.Debug("Couldnt find any data on the epg provider looking through the local cache"); programInfos = GetEpgDataForChannel(channelId); } else { _logger.Debug("Found data on the epg provider saving it to the local cache"); SaveEpgDataForChannel(channelId, programInfos); } return(programInfos); }
public async Task <IEnumerable <ProgramInfo> > GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) { return(await _tvGuide.getTvGuideForChannel(channelId, startDateUtc, endDateUtc, cancellationToken)); }