private void queueStatusButton_Click(object sender, EventArgs e) { if (Uploader.State == UploaderState.NotRunning) { Uploader.StartUploader(); } else { Uploader.CancelAll(); } }
private void EndIfShouldEnd() { if (EndAfterUpload && WatchedProcesses.AllProcessesCompleted && Uploader.State != UploaderState.Uploading && (Uploader.State != UploaderState.Waiting || !Uploader.Queue.Any(u => u.State == JobState.NotStarted && !u.ShouldBeSkipped)) && Searcher.State != RunningState.Running) { LOGGER.Info($"Auto uploader should end now"); Uploader.CancelAll(); DirectoryWatcher.Cancel(); RefreshState(); } }
public void Cancel(bool cancelYoutubeUploader) { LOGGER.Debug($"Received cancel request"); if (State == RunningState.Running) { LOGGER.Info($"Cancelling auto uploader"); State = RunningState.CancelPending; Uploader.StopAfterCompleting = true; Searcher.Cancel(); DirectoryWatcher.Cancel(); if (cancelYoutubeUploader) { LOGGER.Info($"Cancelling youtube uploader"); Uploader.CancelAll(); } RefreshState(); } }