|
|
|
@ -100,8 +100,11 @@ namespace NzbDrone.Test.Common
|
|
|
|
|
private void SetApiKey()
|
|
|
|
|
{
|
|
|
|
|
var configFile = Path.Combine(AppData, "config.xml");
|
|
|
|
|
var attempts = 0;
|
|
|
|
|
|
|
|
|
|
while (ApiKey == null)
|
|
|
|
|
while (ApiKey == null && attempts < 50)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (File.Exists(configFile))
|
|
|
|
|
{
|
|
|
|
@ -112,6 +115,13 @@ namespace NzbDrone.Test.Common
|
|
|
|
|
ApiKey = apiKeyElement.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Error getting API Key from XML file: " + ex.Message, ex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attempts++;
|
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|