Exemplo n.º 1
0
        public RefreshPlaylistsForm(PlaylistPersistor playlistPersistor, IYoutubeAccount account)
        {
            LOGGER.Info($"Initializing new instance of RefreshPlaylistsForm");

            InitializeComponent();

            PlaylistPersistor = playlistPersistor;
            Account           = account;

            RefreshListView();
        }
Exemplo n.º 2
0
        private void refreshButton_Click(object sender, EventArgs e)
        {
            LOGGER.Info($"Refreshing playlists of the youtube account");

            Enabled = false;

            PlaylistPersistor.Container.UnregisterAllPlaylists();

            var playlists = new YoutubePlaylistCommunicator().LoadPlaylists(Account);

            foreach (var playlist in playlists)
            {
                LOGGER.Info($"Found playlist '{playlist.Title}'");
                PlaylistPersistor.Container.RegisterPlaylist(playlist);
            }

            PlaylistPersistor.Save();

            RefreshListView();

            Enabled = true;
        }