debugging info
maybe I should stop pre-released :/
This commit is contained in:
parent
10face4c9e
commit
05b6ce6d8b
17
Program.cs
17
Program.cs
@ -48,7 +48,7 @@ namespace creatureBirdDwarf
|
||||
Console.WriteLine("no oracled.json, can't help but assume contents will be different");
|
||||
}
|
||||
|
||||
if (needUpdate("./oracled.json", "./oracle-now.json"))
|
||||
if (needUpdate("./oracle-now.json", "./oracled.json"))
|
||||
{
|
||||
Console.WriteLine("looks different, going to have to update.");
|
||||
Console.WriteLine("scryfall requests 50-100 ms between requests. Granted I can't imagine it hasn't been that long.");
|
||||
@ -81,6 +81,7 @@ namespace creatureBirdDwarf
|
||||
var rhs = JsonConvert.DeserializeObject<List<Card>>(File.ReadAllText(path2));
|
||||
if(lhs == null || rhs == null)
|
||||
{
|
||||
Console.WriteLine($"one list not found.");
|
||||
return true;
|
||||
}
|
||||
foreach(var lhsCard in lhs)
|
||||
@ -88,19 +89,31 @@ namespace creatureBirdDwarf
|
||||
var rhsCard = rhs.FirstOrDefault(c => c.oracle_id == lhsCard.oracle_id);
|
||||
if(rhsCard == null || lhsCard.oracle_text != rhsCard.oracle_text)
|
||||
{
|
||||
Console.WriteLine($"{lhsCard.name} looks updated.");
|
||||
if(rhsCard == null)
|
||||
{
|
||||
Console.WriteLine($"no rhs card. added or removed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("oracle text different:");
|
||||
Console.WriteLine(lhsCard.oracle_text);
|
||||
Console.WriteLine(rhsCard.oracle_text);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
rhs.Remove(rhsCard);
|
||||
}
|
||||
if(rhs.Count() > 0)
|
||||
{
|
||||
Console.WriteLine($"at least 1 card added or removed: {rhs.First().name}");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("1 path not found.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user