Beispiel #1
0
        private void StartMaintenance(MaintenanceSettings settings)
        {
            if (!CheckAccountDetails() || maintenanceRunning)
            {
                return;
            }

            // update file log with new name
            FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";

            var maintThread = new Thread(o =>
            {
                maintenanceRunning = true;
                Maintenance.Cancel = false;

                // only one import at a time
                SetControlState(false);

                // Clear Progress
                ClearProgress();

                // Login to trakt.tv
                if (!Login())
                {
                    return;
                }

                // Cleanup user data from trakt.tv
                if (settings.WatchedHistoryEpisodes)
                {
                    Maintenance.RemoveEpisodesFromWatchedHistory();
                }
                if (settings.WatchedHistoryMovies)
                {
                    Maintenance.RemoveMoviesFromWatchedHistory();
                }
                if (settings.CollectedEpisodes)
                {
                    Maintenance.RemoveEpisodesFromCollection();
                }
                if (settings.CollectedMovies)
                {
                    Maintenance.RemoveMoviesFromCollection();
                }
                if (settings.RatedEpisodes)
                {
                    Maintenance.RemoveEpisodesFromRatings();
                }
                if (settings.RatedShows)
                {
                    Maintenance.RemoveShowsFromRatings();
                }
                if (settings.RatedSeasons)
                {
                    Maintenance.RemoveSeasonsFromRatings();
                }
                if (settings.RatedMovies)
                {
                    Maintenance.RemoveMoviesFromRatings();
                }
                if (settings.WatchlistEpisodes)
                {
                    Maintenance.RemoveEpisodesFromWatchlist();
                }
                if (settings.WatchlistShows)
                {
                    Maintenance.RemoveShowsFromWatchlist();
                }
                if (settings.WatchlistSeasons)
                {
                    Maintenance.RemoveSeasonsFromWatchlist();
                }
                if (settings.WatchlistMovies)
                {
                    Maintenance.RemoveMoviesFromWatchlist();
                }

                // finished
                SetControlState(true);
                UIUtils.UpdateStatus("Maintenance Complete!");
                maintenanceRunning = false;
            });

            maintThread.Start();
        }
Beispiel #2
0
 public MaintenanceDialog()
 {
     InitializeComponent();
     Settings = new MaintenanceSettings();
 }
Beispiel #3
0
        private void StartMaintenance(MaintenanceSettings settings)
        {
            if (!CheckAccountDetails() || maintenanceRunning)
                return;

            // update file log with new name
            FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";

            var maintThread = new Thread(o =>
            {
                maintenanceRunning = true;
                Maintenance.Cancel = false;

                // only one import at a time
                SetControlState(false);

                // Clear Progress
                ClearProgress();

                // Login to trakt.tv
                if (!Login())
                    return;

                // Cleanup user data from trakt.tv
                if (settings.WatchedHistoryEpisodes)
                {
                    Maintenance.RemoveEpisodesFromWatchedHistory();
                }
                if (settings.WatchedHistoryMovies)
                {
                    Maintenance.RemoveMoviesFromWatchedHistory();
                }
                if (settings.CollectedEpisodes)
                {
                    Maintenance.RemoveEpisodesFromCollection();
                }
                if (settings.CollectedMovies)
                {
                    Maintenance.RemoveMoviesFromCollection();
                }
                if (settings.RatedEpisodes)
                {
                    Maintenance.RemoveEpisodesFromRatings();
                }
                if (settings.RatedShows)
                {
                    Maintenance.RemoveShowsFromRatings();
                }
                if (settings.RatedSeasons)
                {
                    Maintenance.RemoveSeasonsFromRatings();
                }
                if (settings.RatedMovies)
                {
                    Maintenance.RemoveMoviesFromRatings();
                }
                if (settings.WatchlistEpisodes)
                {
                    Maintenance.RemoveEpisodesFromWatchlist();
                }
                if (settings.WatchlistShows)
                {
                    Maintenance.RemoveShowsFromWatchlist();
                }
                if (settings.WatchlistSeasons)
                {
                    Maintenance.RemoveSeasonsFromWatchlist();
                }
                if (settings.WatchlistMovies)
                {
                    Maintenance.RemoveMoviesFromWatchlist();
                }

                // finished
                SetControlState(true);
                UIUtils.UpdateStatus("Maintenance Complete!");
                maintenanceRunning = false;
            });

            maintThread.Start();
        }
 public MaintenanceDialog()
 {
     InitializeComponent();
     Settings = new MaintenanceSettings();
 }