private async Task <IEnumerable <ChannelMediaInfo> > RetrieveChannelMediaInfoWithId(string id, CancellationToken cancellationToken)
        {
            var twitchVideoId = new TwitchVideoId(id);
            var broadcast     = await _twitchService.GetBroadcast(twitchVideoId.Id, cancellationToken);

            return(broadcast.Chunks
                   .OrderByDescending(pair => pair.Key)
                   .First()
                   .Value
                   .Select(CreateChannelMediaInfo));
        }
Пример #2
0
        private ChannelItemInfo CreateChannelItemVideo(VideoLink videoLink)
        {
            var twitchVideoId = new TwitchVideoId(videoLink.TwitchId, videoLink.TimeStart);

            return(new ChannelItemInfo
            {
                ContentType = ChannelMediaContentType.Clip,
                Id = twitchVideoId.ToString(),
                MediaType = ChannelMediaType.Video,
                Name = videoLink.Title,
                Type = ChannelItemType.Media
            });
        }
Пример #3
0
        private ChannelItemInfo CreateChannelItemVideo(Day day)
        {
            var twitchVideoId = new TwitchVideoId(day.FullStream.TwitchId, day.FullStream.TimeStart);

            return(new ChannelItemInfo
            {
                ContentType = ChannelMediaContentType.Clip,
                Id = twitchVideoId.ToString(),
                ImageUrl = day.ImageUrl,
                MediaType = ChannelMediaType.Video,
                Name = day.FullStream.Title,
                Type = ChannelItemType.Media
            });
        }