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; }
internal new static RestChannel Create(BaseRestClient client, Model model) { var entity = new RestChannel(client, model.Id); entity.Update(model); return(entity); }
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)); }
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(); }
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); }
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); }
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; }
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()); }
internal override void Update(Model model) { Channel = new RestChannel(Client, model.Channel.Id); Channel.Update(model.Channel); base.Update(model); }