Пример #1
0
        public async Task Integration_VimeoClient_GetAccountVideos_SecondPage()
        {
            // arrange
            VimeoClient client = CreateAuthenticatedClient();

            // act
            Paginated <Video> videos = await client.GetVideosAsync(page : 2, perPage : 5);

            // assert
            Assert.IsNotNull(videos);
        }
Пример #2
0
        public override TaskStatus Run()
        {
            Info("Listing uploads...");

            WorkflowStatus status = WorkflowStatus.Success;

            try
            {
                var xmlPath = Path.Combine(Workflow.WorkflowTempFolder,
                                           string.Format("{0}_{1:yyyy-MM-dd-HH-mm-ss-fff}.xml", "VimeoListUploads", DateTime.Now));

                var xdoc    = new XDocument(new XElement("VimeoListUploads"));
                var xvideos = new XElement("Videos");

                var vimeoApi   = new VimeoClient(Token);
                var videosTask = vimeoApi.GetVideosAsync(UserId, null, null);
                videosTask.Wait();
                var videos = videosTask.Result.Data;

                foreach (var d in videos)
                {
                    xvideos.Add(new XElement("Video"
                                             , new XAttribute("title", SecurityElement.Escape(d.Name))
                                             , new XAttribute("uri", SecurityElement.Escape(d.Uri))
                                             , new XAttribute("created_time", SecurityElement.Escape(d.CreatedTime.ToString()))
                                             , new XAttribute("status", SecurityElement.Escape(d.Status))
                                             ));
                }

                xdoc.Root.Add(xvideos);
                xdoc.Save(xmlPath);
                Files.Add(new FileInf(xmlPath, Id));
                InfoFormat("Results written in {0}", xmlPath);
            }
            catch (ThreadAbortException)
            {
                throw;
            }
            catch (Exception e)
            {
                ErrorFormat("An error occured while listing uploads: {0}", e.Message);
                status = WorkflowStatus.Error;
            }

            Info("Task finished.");
            return(new TaskStatus(status));
        }
Пример #3
0
        public async Task <VimeoDotNet.Models.Paginated <VimeoDotNet.Models.Video> > GetVideos()
        {
            _user = _user ?? await _vimeoClient.GetAccountInformationAsync();

            return(await _vimeoClient.GetVideosAsync(_user.Id, 1, 50));
        }