private void bttn_Download_Click(object sender, EventArgs e) { if (lstv_Downloads.Items.Count > 0) { ATorrent DLList = new ATorrent(100); AMediaFile dlList = new AMediaFile(100); foreach (ListViewItem li in lstv_Downloads.Items) { ATorrent t = new ATorrent(); t.Name = li.Text; t.Seeders = Int32.Parse(li.SubItems[1].Text); t.FileSize = li.SubItems[2].Text; t.Quality = li.SubItems[3].Text; t.DaysOld = li.SubItems[4].Text; t.Language = li.SubItems[5].Text; t.Link = li.SubItems[6].Text; DLList.Add(t); AMediaFile mf = new AMediaFile(li.Text); dlList.Add(mf); } Utility.Download(DLList.Torrents); // UpdateAfterDownload(lstv_Downloads.Items); } //else lblSearch.Text = "You must select shows to download first!"; //update fav box //lstbx_Favorites.Items.Clear(); //foreach (AShow ms in availableShows.LatestShows) // lstbx_Favorites.Items.Add(ms.ToString()); }
private AShow[] CheckForNewEpisodes(bool SearchAll, int MinSeeders) { ATorrent DLList = new ATorrent(); DLList.Torrents = new ATorrent[100]; int i = 0; int OGepi = 0; ATorrent results = new ATorrent(35); foreach (AShow t in Favorites.Shows)//Favorites.Shows) { if (t != null & t.MyType == "TV") { bool SearchAgain = true; OGepi = t.Episode; while (SearchAgain == true) { SearchAgain = false; t.Episode += 1; Search search = new Search(t.ToString(), MinSeeders, SearchAll); search.StartSearching(); results.Torrents = search.Results.Torrents; if (results.Torrents[0] != null && results.Torrents[0].Name != "No Results Found!") { if (results.Torrents[0].Name != "9999" & results.ExactMatch(t) != 9999) { if (DLList.ExactMatch(t) == 9999) { DLList.Add(results.Torrents[0]); SearchAgain = SearchAll;//true to keep searching for the next episode } } } } t.Episode = OGepi; i++; int poss = 0; foreach (AShow x in Favorites.Shows) { if (x != null) { poss++; } else break; } float a = poss; float b = i; int c = Convert.ToInt32((b / a) * 100); bgw_SearchForNewEpisodes.ReportProgress(c); } else break; } return DLList.Torrents; }