Skip to content

Commit

Permalink
Fixed GHA Tests (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronelm2000 committed Dec 14, 2021
1 parent 378efed commit 56e0eb5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions MontageWeissTools/Impls/PostProcessors/JKTCGPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public async Task<bool> IsCompatible(List<WeissSchwarzCard> cards)
Log.Warning("JKTCG Image Post-Processor is disabled for sets with multiple Release IDs; please add those images manually when prompted.");
return false;
}
else if (!(await GetSetListURI(firstCard)).HasValue)

var setList = await GetSetListURI(firstCard);
if (!setList.HasValue)
{
Log.Information("Unable to find info from JKTCG; likely a new set, will skip.");
return false;
Expand Down Expand Up @@ -143,10 +145,17 @@ private object GetSerial(IHtmlImageElement ele)

private async Task<(string setLinkWithUnderscores, string url)?> GetSetListURI(WeissSchwarzCard firstCard)
{
var menu = await "http://jktcg.com/MenuLeftEN.html"
.WithHTMLHeaders()
.GetHTMLAsync();
return CardListURLFrom(menu, firstCard);
try
{
var menu = await "http://jktcg.com/MenuLeftEN.html"
.WithHTMLHeaders()
.GetHTMLAsync();
return CardListURLFrom(menu, firstCard);
}
catch (Exception)
{
return null;
}
}

private (string setLinkWithUnderscores, string url)? CardListURLFrom(IDocument menu, WeissSchwarzCard firstCard)
Expand Down

0 comments on commit 56e0eb5

Please sign in to comment.