Пример #1
0
 public async Task<ChannelItemResult> FindEvents(int limit, int offset, CancellationToken cancellationToken)
 {
     var events = await GetEvents(limit, offset, cancellationToken);
     var result = new ChannelItemResult
     {
         Items = events.Items
             .Where(evt => evt.Status != EventStatus.None)
             .Select(CreateChannelItemFolders)
             .ToList()
     };
     result.TotalRecordCount = SetTotalRecordCount(limit, offset, result.Items.Count, events.After);
     return result;
 }
Пример #2
0
        public async Task<ChannelItemResult> FindMatches(string eventId, string dayId, CancellationToken cancellationToken)
        {
            var days = await _lolEventVodsService.GetEventDays(eventId, cancellationToken);
            var day = days.FirstOrDefault(d => d.DayId == dayId);
            if (day == null)
            {
                _logger.Warn("DayId \"{0}\" couldn't be found in EventId \"{1}\"", dayId, eventId);
                return new ChannelItemResult();
            }

            var result = new ChannelItemResult { Items = new List<ChannelItemInfo>() };
            if (day.FullStream != null)
            {
                result.Items.Add(CreateChannelItemVideo(day));
            }
            result.Items.AddRange(day.Matches
                .Select(match => CreateChannelItemFolders(eventId, dayId, match)));
            result.TotalRecordCount = result.Items.Count;
            return result;
        }