Esempio n. 1
0
        static void OverallTest()
        {
            var processor = new YoutubeApisProcessor();
            var directory = new DirectoryInfo(".");

            processor.Authorize(directory);
            var videos = processor.GetAllClips();

            foreach (var video in videos)
            {
                Console.WriteLine("{0,-15}{1,10}", video.Id, video.Name);
            }

            var v = videos.First();

            processor.UpdateVideoThumbnail(v, new FileInfo("aiml.png"));

            return;

            v.Name        = "XXX";
            v.Description = "YYY";
            processor.UpdateVideo(v);

            var lists = processor.GetAllPlaylists();

            foreach (var list in lists)
            {
                Console.WriteLine("{0}", list.PlaylistTitle);
                processor.DeletePlaylist(list);
            }
            var newList = processor.CreatePlaylist("Test");

            processor.FillPlaylist(newList, videos);
        }
Esempio n. 2
0
        static void OverallTest()
        {
            var processor = new YoutubeApisProcessor();
            var directory = new DirectoryInfo(".");
            processor.Authorize(directory);
            var videos = processor.GetAllClips();
            foreach (var video in videos)
                Console.WriteLine("{0,-15}{1,10}", video.Id, video.Name);

            var v = videos.First();
            processor.UpdateVideoThumbnail(v, new FileInfo("aiml.png"));

            return;
            v.Name = "XXX";
            v.Description = "YYY";
            processor.UpdateVideo(v);

            var lists = processor.GetAllPlaylists();
            foreach (var list in lists)
            {
                Console.WriteLine("{0}", list.PlaylistTitle);
                processor.DeletePlaylist(list);
            }
            var newList = processor.CreatePlaylist("Test");
            processor.FillPlaylist(newList, videos);
        }
Esempio n. 3
0
        public override void Work()
        {
            if (YoutubeApisProcessor.Current == null)
            {
                YoutubeApisProcessor.Initialize(Model.Videotheque.TempFolder);
            }
            Action <int> percentageUpdate = (int percentage) => { Progress = Math.Min(100, percentage); };
            var          newId            = YoutubeApisProcessor.Current.UploadVideo(pathToFile, episode.Name, episode.Guid, percentageUpdate);

            if (episode.YoutubeId != null)
            {
                YoutubeApisProcessor.Current.DeleteVideo(episode.YoutubeId);
            }
            episode.YoutubeId = newId;
            Model.Save();
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                MessageBox.Show("This program should be called with an argument: the path to videotheque file");
                return;
            }

            videotheque = Videotheque.Load(args[0], null, true);
            OpenModel("LHPS");
            YoutubeApisProcessor.Initialize(videotheque.TempFolder);

            Application = new System.Windows.Application();
            var viewModel = new MainViewModel(videotheque, publishingModel, () => SourcesFactory());
            var window    = new MainWindow();

            window.DataContext = viewModel;
            Application.Run(window);
        }