private async void btn_download_x_Click(object sender, EventArgs e) { string xForDownload = ""; if (chkbox_last_ep.Checked) { Tuple <string, string> showEp = await Util.GetLastSeasonAndEpisode(txtbox_show_ep.Text); xForDownload = txtbox_show_ep.Text + " S" + showEp.Item1 + "E" + showEp.Item2; } else { xForDownload = txtbox_show_ep.Text; } if (chk_720p.Checked) { xForDownload += " 720p"; } string xForUrl = xForDownload.Trim().Replace(" ", "%20"); DataTable links = Util.GetMagnetsFromTPB(xForUrl); if (links.Rows.Count > 0) { MagnetLinks formMagnetLinks = new MagnetLinks(links, xForDownload); formMagnetLinks.Show(); } else { MessageBox.Show("Your search returned no results!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btn_download_Click(object sender, EventArgs e) { string xForDownload = ""; if (chk_season.Checked) { xForDownload = data.name + " season " + data._embedded.episodes[curShowIndex].season; } else { string season = (int.Parse(lbl_season.Text) < 10 ? 0 + "" : "") + int.Parse(lbl_season.Text); string episode = (int.Parse(lbl_ep_num.Text) < 10 ? 0 + "" : "") + int.Parse(lbl_ep_num.Text); xForDownload = data.name + " S" + season + "E" + episode; } if (chk_720p.Checked) { xForDownload += " 720p"; } string xForUrl = xForDownload.Trim().Replace(" ", "%20"); DataTable links = Util.GetMagnetsFromTPB(xForUrl); if (links.Rows.Count > 0) { MagnetLinks formMagnetLinks = new MagnetLinks(links, xForDownload); formMagnetLinks.Show(); } else { MessageBox.Show("Your search returned no results!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }