change namings, port, fix clearing uploads

This commit is contained in:
Stanley Dimant
2022-07-01 11:29:19 +02:00
parent 320b80e3ae
commit 35b12720c6
4 changed files with 38 additions and 8 deletions

View File

@@ -114,6 +114,35 @@ namespace MareSynchronos
UidComments.Clear();
Save();
}
if (Version == 1)
{
Logger.Debug("Migrating Configuration from V1 to V2");
ApiUri = ApiUri.Replace("5001", "5000");
foreach (var kvp in ClientSecret.ToList())
{
var newKey = kvp.Key.Replace("5001", "5000");
ClientSecret.Remove(kvp.Key);
if (ClientSecret.ContainsKey(newKey))
{
ClientSecret[newKey] = kvp.Value;
}
else
{
ClientSecret.Add(newKey, kvp.Value);
}
}
foreach (var kvp in UidServerComments.ToList())
{
var newKey = kvp.Key.Replace("5001", "5000");
UidServerComments.Remove(kvp.Key);
UidServerComments.Add(newKey, kvp.Value);
}
Version = 2;
Save();
}
}
}
}