public void DownloadGathererImages(string setCode) { var client = new GathererClient(); var set = Repo.SetsByCode[setCode]; foreach (var card in set.Cards) { client.DownloadCardImage(card, GathererOriginalDir); } }
public void Update_translations() { Directory.CreateDirectory(ParsedDir); Directory.CreateDirectory(ResultDir); var client = new GathererClient(Repo); client.DownloadTranslations(DownloadedDir); client.ParseTranslations(DownloadedDir, ParsedDir); client.MergeTranslations(ParsedDir, ResultDir); client.SaveNonEnglishTranslations(ResultDir); }
public void DownloadGathererImages(string setCode, bool useCustomSet) { var repo = new CardRepository(); if (useCustomSet) { repo.SetsFile = null; repo.CustomSetCodes = new[] { setCode }; } repo.FilterSetCode = code => Str.Equals(code, setCode); repo.LoadFile(); repo.Load(); var set = repo.SetsByCode[setCode]; var client = new GathererClient(); var setDirectory = Path.Combine(GathererOriginalDir, set.Code); Directory.CreateDirectory(setDirectory); foreach (var card in set.Cards) { if (!card.MultiverseId.HasValue) { continue; } string targetFile = Path.Combine(setDirectory, card.ImageName + ".png"); string processedFile = Path.Combine(setDirectory, card.ImageName + ".jpg"); if (File.Exists(targetFile) || File.Exists(processedFile)) { continue; } client.DownloadCardImage(card.MultiverseId.Value, targetFile); } }