public async void StartDownloadSequence() { _is_downloading = true; LockView(); List <ImageTag> tags = ImageTag.ParseTags(Tags.Text) as List <ImageTag>; ImageTag rating_tag = Post.RatingTag(CurrentRating()); if (!(await CurrentBoard.GetBestTags(tags, rating_tag) is List <ImageTag> best_tags)) { DownloadFailed("Failed to get optimal tags"); return; } if (CancelQueued) { ResetView("Download canceled"); return; } List <Post> posts; try { posts = await CurrentBoard.GetPages(best_tags, tags, CurrentRating(), -1, this) as List <Post>; if (posts == null) { ResetView("Download canceled"); return; } } catch (WebException e) { DownloadFailed(e.Message); return; } if (posts.Count == 0) { DownloadFailed($"No posts were found for {best_tags.AsTagString(' ')}"); ResetView(); return; } if (CancelQueued) { ResetView("Download canceled"); return; } string output_base; try { output_base = GetOutputPath(tags); } catch (InvalidPathException e) { DownloadFailed(e.Message); return; } await DownloadPosts(posts, output_base); ResetView($"Downloading {(CancelQueued ? "canceled" : "finished")}"); }