Compare commits

...

2 Commits

Author SHA1 Message Date
7f491ef632 one more thing 2023-04-14 22:14:23 -04:00
68ce0ed6fd publish better 2023-04-14 22:06:28 -04:00
2 changed files with 10 additions and 0 deletions

View File

@ -66,6 +66,13 @@ namespace silverworker_discord.Conversion
private static void loadCurrency() private static void loadCurrency()
{ {
Console.WriteLine("loading currency exchange data."); Console.WriteLine("loading currency exchange data.");
if(currencyConf != null)
{
knownConversions.RemoveAll(kc => kc.Item1 == currencyConf.Base);
knownAliases.Remove(knownAliases.FirstOrDefault(kvp => kvp.Value == currencyConf.Base).Key);
foreach (var rate in currencyConf.rates)
knownAliases.Remove(knownAliases.FirstOrDefault(kvp => kvp.Value == rate.Key).Key);
}
if (File.Exists(currencyPath)) if (File.Exists(currencyPath))
{ {
currencyConf = JsonConvert.DeserializeObject<ExchangePairs>(File.ReadAllText(currencyPath)); currencyConf = JsonConvert.DeserializeObject<ExchangePairs>(File.ReadAllText(currencyPath));

View File

@ -25,6 +25,9 @@
<None Update="assets/ekgblip.png"> <None Update="assets/ekgblip.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Update="assets/conversion.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="appsettings.json"> <None Update="appsettings.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None> </None>