Exemplo n.º 1
0
        internal override void Update(Model model)
        {
            base.Update(model);

            Title              = model.Title;
            Description        = model.Description;
            DescriptionHtml    = model.Description;
            BroadcastId        = model.BroadcastId;
            BroadcastType      = model.BroadcastType;
            Status             = model.Status;
            Tags               = model.Tags.Split(' ');
            Language           = model.Language;
            Game               = model.Game;
            Length             = model.Length;
            Views              = model.Views;
            Viewable           = model.Viewable;
            ViewableAt         = model.ViewableAt;
            CreatedAt          = model.CreatedAt;
            PublishedAt        = model.PublishedAt;
            RecordedAt         = model.RecordedAt;
            AnimatedPreviewUrl = model.AnimatedPreviewUrl;
            Qualities          = model.Fps;
            Resolutions        = model.Resolutions;

            Channel = RestChannel.Create(Client, model.Channel);

            //Preview = model.Preview;
            //Thumbnail = model.Thumbnails;
        }
Exemplo n.º 2
0
        public static async Task <RestChannel> GetChannelAsync(BaseRestClient client, ulong channelId)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetChannelInternalAsync(token, channelId);

            return(RestChannel.Create(client, model));
        }
Exemplo n.º 3
0
        public static async Task <IReadOnlyCollection <RestChannel> > FindChannelAsync(BaseTwitchClient client, string query, PageOptions paging = null, RequestOptions options = null)
        {
            var model = await client.ApiClient.FindChannelsAsync(query, paging, options).ConfigureAwait(false);

            if (model.Channels != null)
            {
                return(model.Channels.Select(x => RestChannel.Create(client, x)).ToArray());
            }
            return(null);
        }
Exemplo n.º 4
0
        public static async Task <RestChannel> GetChannelAsync(BaseTwitchClient client, ulong channelId, RequestOptions options = null)
        {
            var model = await client.ApiClient.GetChannelAsync(channelId, options).ConfigureAwait(false);

            if (model != null)
            {
                return(RestChannel.Create(client, model));
            }
            return(null);
        }
Exemplo n.º 5
0
        internal static async Task <IReadOnlyCollection <RestChannel> > SearchChannelsAsync(BaseRestClient client, string query, uint limit, uint offset)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.SearchChannelsInternalAsync(token, query, limit, offset);

            if (model == null)
            {
                return(new List <RestChannel>());
            }

            var entity = model.Channels.Select(x => RestChannel.Create(client, x));

            return(entity.ToArray());
        }