public IReadOnlyList <KeyValuePair <string, object> > GetUrls(WebAccess webAccess) { IList <KeyValuePair <string, object> > urls = new List <KeyValuePair <string, object> >(); string json = webAccess.GetHtml(Scryfall); BulkDataList bulkDataList = JsonConvert.DeserializeObject <BulkDataList>(json); BulkData bulkData = bulkDataList.Data.FirstOrDefault(d => d.Type == WantedBulkType); if (bulkData != null) { urls.Add(new KeyValuePair <string, object>(bulkData.DownloadUri, bulkData)); } return(urls.ToArray()); }
public IEnumerable <EditionInfoWithBlock> GetEditionList(string url) { string htmltext = _webAccess.GetHtml(url); foreach (EditionInfo editionInfo in Parser.ParseEditionsList(htmltext)) { IEdition edition = MagicDatabase.GetEdition(editionInfo.Name); if (edition == null) { OnNewEditionCreated(editionInfo.Name); edition = MagicDatabase.GetEdition(editionInfo.Name); } yield return(new EditionInfoWithBlock(editionInfo, edition)); } }