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
        internal new static RestChannel Create(BaseRestClient client, Model model)
        {
            var entity = new RestChannel(client, model.Id);

            entity.Update(model);
            return(entity);
        }
Exemplo n.º 3
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.º 4
0
 internal override void Update(Model model)
 {
     base.Update(model);
     Channels = model.Channels.Select(x =>
     {
         var entity = new RestChannel(Client, x.Id);
         entity.Update(x);
         return(entity);
     }).ToArray();
 }
Exemplo n.º 5
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.º 6
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.º 7
0
        internal virtual void Update(Model model)
        {
            Channel = new RestChannel(Client, model.Channel.Id);
            Channel.Update(model.Channel);

            CreatedAt   = model.CreatedAt;
            Game        = model.Game;
            Delay       = model.Delay;
            Viewers     = model.Viewers;
            VideoHeight = model.VideoHeight;
            AverageFps  = model.AverageFps;
            IsPlaylist  = model.IsPlaylist;
            Previews    = model.Previews;
        }
Exemplo n.º 8
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());
        }
Exemplo n.º 9
0
 internal override void Update(Model model)
 {
     Channel = new RestChannel(Client, model.Channel.Id);
     Channel.Update(model.Channel);
     base.Update(model);
 }