public static async Task <RestVideo> GetVideoAsync(BaseRestClient client, string id) { var token = TokenHelper.GetSingleToken(client); var model = await client.RestClient.GetVideoInternalAsync(token, id); return(RestVideo.Create(client, model)); }
public static async Task <IReadOnlyCollection <RestVideo> > GetFollowedVideosAsync(BaseTwitchClient client, string broadcastType, string language, string sort, PageOptions paging, RequestOptions options) { var model = await client.ApiClient.GetFollowedVideosAsync(broadcastType, language, sort, paging, options).ConfigureAwait(false); if (model.Videos != null) { return(model.Videos.Select(x => RestVideo.Create(client, x)).ToArray()); } return(null); }
// Videos public static async Task <RestVideo> GetVideoAsync(BaseTwitchClient client, string videoId, RequestOptions options = null) { var model = await client.ApiClient.GetVideoAsync(videoId, options).ConfigureAwait(false); if (model != null) { return(RestVideo.Create(client, model)); } return(null); }
// Videos public static async Task <IReadOnlyCollection <RestVideo> > GetVideosAsync(BaseTwitchClient client, ulong channelId, PageOptions paging = null, RequestOptions options = null) { var model = await client.ApiClient.GetChannelVideosAsync(channelId, paging, options).ConfigureAwait(false); return(model.Videos.Select(x => RestVideo.Create(client, x)).ToArray()); }