Exemple #1
0
 private async Task UpdateChannels( Dictionary<string, List<UserPost>> newPosts, VideosResource.ListRequest req ) {
     for ( var i = 0; i < newPosts.Keys.Count; i += 50 ) {
         req.Id = string.Join( ",", newPosts.Keys.Skip( i ).Take( 50 ) );
         var response = await req.ExecuteAsync();
         foreach ( var vid in response.Items ) {
             foreach ( var upost in newPosts[vid.Id] ) {
                 upost.ChannelID = vid.Snippet.ChannelId;
                 upost.ChannelName = vid.Snippet.ChannelTitle;
                 UserPost.UpdatePost( upost );
             }
         }
     }
 }