コード例 #1
0
        internal static RestVideo Create(BaseTwitchClient client, Model model)
        {
            var entity = new RestVideo(client, model.Id);

            entity.Update(model);
            return(entity);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public static async Task ModifyAsync(RestVideo video, Action <ModifyVideoParams> changes, RequestOptions options)
        {
            var modify = new ModifyVideoParams();

            changes.Invoke(modify);

            var model = await video.Client.ApiClient.ModifyVideoAsync(video.Id, modify, options);

            video.Update(model);
        }
コード例 #4
0
ファイル: ClientHelper.cs プロジェクト: kouweizhong/NTwitch
        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);
        }
コード例 #5
0
ファイル: ClientHelper.cs プロジェクト: kouweizhong/NTwitch
        // 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);
        }
コード例 #6
0
ファイル: ChannelHelper.cs プロジェクト: kouweizhong/NTwitch
        // 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());
        }
コード例 #7
0
 public static Task CompleteUploadAsync(RestVideo video, RequestOptions options)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public static async Task DeleteAsync(RestVideo video, RequestOptions options)
 {
     await video.Client.ApiClient.DeleteVideoAsync(video.Id, options).ConfigureAwait(false);
 }