Merge pull request #58 from PTMagicians/revert-57-develop

Revert "Minor Fixes"
This commit is contained in:
HojouFotytu 2019-02-17 21:40:07 +09:00 committed by GitHub
commit 87d3f50726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 19 deletions

View File

@ -48,7 +48,6 @@ namespace Core.Main.DataObjects.PTMagicData
public string TimezoneOffset { get; set; } = "+0:00"; public string TimezoneOffset { get; set; } = "+0:00";
public string MainFiatCurrency { get; set; } = "USD"; public string MainFiatCurrency { get; set; } = "USD";
public string CoinMarketCapAPIKey { get; set; } public string CoinMarketCapAPIKey { get; set; }
public string FreeCurrencyConverterAPIKey { get; set; }
} }
public class Monitor public class Monitor

View File

@ -560,7 +560,6 @@ namespace Core.Main
SettingsFiles.CheckPresets(this.PTMagicConfiguration, this.Log, true); SettingsFiles.CheckPresets(this.PTMagicConfiguration, this.Log, true);
EnforceSettingsReapply = true; EnforceSettingsReapply = true;
this.StartPTMagicIntervalTimer(); this.StartPTMagicIntervalTimer();
return result; return result;
@ -671,16 +670,6 @@ namespace Core.Main
{ {
this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json"); this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json");
} }
// Check for CurrencyConverterApi Key
if (!this.PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey.Equals(""))
{
this.Log.DoLogInfo("FreeCurrencyConverterApi KEY found");
}
else
{
this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified! You can't use non USD Currencies!");
}
} }
else else
@ -799,9 +788,7 @@ namespace Core.Main
this.RunCount++; this.RunCount++;
bool headerLinesAdded = false; bool headerLinesAdded = false;
this.EnforceSettingsReapply = this.HaveSettingsChanged();
// Force update from preset files with every run
this.EnforceSettingsReapply = true; // = this.HaveSettingsChanged();
if (PTMagicConfiguration.GeneralSettings.Application.IsEnabled) if (PTMagicConfiguration.GeneralSettings.Application.IsEnabled)
{ {
@ -1034,7 +1021,7 @@ namespace Core.Main
try try
{ {
this.LastRuntimeSummary.MainFiatCurrency = this.PTMagicConfiguration.GeneralSettings.Application.MainFiatCurrency; this.LastRuntimeSummary.MainFiatCurrency = this.PTMagicConfiguration.GeneralSettings.Application.MainFiatCurrency;
this.LastRuntimeSummary.MainFiatCurrencyExchangeRate = BaseAnalyzer.GetMainFiatCurrencyRate(this.PTMagicConfiguration.GeneralSettings.Application.MainFiatCurrency, this.PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey, this.Log); this.LastRuntimeSummary.MainFiatCurrencyExchangeRate = BaseAnalyzer.GetMainFiatCurrencyRate(this.PTMagicConfiguration.GeneralSettings.Application.MainFiatCurrency, this.Log);
this.LastMainFiatCurrency = this.LastRuntimeSummary.MainFiatCurrency; this.LastMainFiatCurrency = this.LastRuntimeSummary.MainFiatCurrency;
this.LastMainFiatCurrencyExchangeRate = this.LastRuntimeSummary.MainFiatCurrencyExchangeRate; this.LastMainFiatCurrencyExchangeRate = this.LastRuntimeSummary.MainFiatCurrencyExchangeRate;

View File

@ -195,11 +195,11 @@ namespace Core.MarketAnalyzer
return result; return result;
} }
public static double GetMainFiatCurrencyRate(string currency, string FreeCurrencyAPI, LogHelper log) public static double GetMainFiatCurrencyRate(string currency, LogHelper log)
{ {
double result = 1; double result = 1;
string baseUrl = "http://free.currencyconverterapi.com/api/v5/convert?q=USD_" + currency + "&compact=y&apiKey="+FreeCurrencyAPI; string baseUrl = "http://free.currencyconverterapi.com/api/v5/convert?q=USD_" + currency + "&compact=y";
log.DoLogDebug("http://free.currencyconverterapi.com - Getting latest exchange rates..."); log.DoLogDebug("http://free.currencyconverterapi.com - Getting latest exchange rates...");
Newtonsoft.Json.Linq.JObject jsonObject = GetSimpleJsonObjectFromURL(baseUrl, log, false); Newtonsoft.Json.Linq.JObject jsonObject = GetSimpleJsonObjectFromURL(baseUrl, log, false);

View File

@ -74,7 +74,6 @@ namespace Monitor.Pages
PTMagicConfiguration.GeneralSettings.Application.FloodProtectionMinutes = SystemHelper.TextToInteger(HttpContext.Request.Form["Application_FloodProtectionMinutes"], PTMagicConfiguration.GeneralSettings.Application.FloodProtectionMinutes); PTMagicConfiguration.GeneralSettings.Application.FloodProtectionMinutes = SystemHelper.TextToInteger(HttpContext.Request.Form["Application_FloodProtectionMinutes"], PTMagicConfiguration.GeneralSettings.Application.FloodProtectionMinutes);
PTMagicConfiguration.GeneralSettings.Application.InstanceName = HttpContext.Request.Form["Application_InstanceName"]; PTMagicConfiguration.GeneralSettings.Application.InstanceName = HttpContext.Request.Form["Application_InstanceName"];
PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey = HttpContext.Request.Form["Application_CoinMarketCapAPIKey"]; PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey = HttpContext.Request.Form["Application_CoinMarketCapAPIKey"];
PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey = HttpContext.Request.Form["Application_FreeCurrencyConverterAPIKey"];
PTMagicConfiguration.GeneralSettings.Monitor.IsPasswordProtected = HttpContext.Request.Form["Monitor_IsPasswordProtected"].Equals("on"); PTMagicConfiguration.GeneralSettings.Monitor.IsPasswordProtected = HttpContext.Request.Form["Monitor_IsPasswordProtected"].Equals("on");
PTMagicConfiguration.GeneralSettings.Monitor.OpenBrowserOnStart = HttpContext.Request.Form["Monitor_OpenBrowserOnStart"].Equals("on"); PTMagicConfiguration.GeneralSettings.Monitor.OpenBrowserOnStart = HttpContext.Request.Form["Monitor_OpenBrowserOnStart"].Equals("on");