private void PerformTorrentBrowse() { try { m_Facade.Clear(); SetGUIProperty(GuiProperty.Browse_Source, EnumTranslator.TorrentSourceTranslated(curBrowseSource)); SetGUIProperty(GuiProperty.Browse_ResultDescription, Translation.Searching + "..."); List<TorrentLink> links = DownloadHelper.BrowseTorrents(curBrowseSource); ShowBrowseResults(links); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in PerformTorrentSearch: {0}", ex.ToString()); return; } }
private void ShowBrowseResults(List<TorrentLink> results) { if (!dummyPageBrowse.Visible) return; m_Facade.Clear(); SetGUIProperty(GuiProperty.Browse_Source, EnumTranslator.TorrentSourceTranslated(curBrowseSource))); foreach (TorrentLink link in results) { GUIListItem item = new GUIListItem(); item.Label = string.Format("{0} ({1})", link.TorrentName, link.Size); item.TVTag = link; m_Facade.Add(item); } SetGUIProperty(GuiProperty.Browse_ResultDescription, string.Format("{0} {1}", results.Count, results.Count == 1 ? Translation.Result : Translation.Results)); m_Facade.Focus = true; }