@@ -48,8 +48,17 @@ namespace Elwig.Helpers {
|
||||
public string? DatabaseLog = null;
|
||||
public string? Branch = null;
|
||||
public WeighingMode? WeighingMode;
|
||||
|
||||
public bool BackupAuto = true;
|
||||
public string BackupPath = Path.Combine(App.DataPath, "backups");
|
||||
public int BackupRetainHours = 36;
|
||||
public int BackupRetainDays = 8;
|
||||
public int BackupRetainWeeks = 6;
|
||||
public int BackupRetainMonths = 18;
|
||||
|
||||
public string? UpdateUrl = null;
|
||||
public bool UpdateAuto = false;
|
||||
|
||||
public string? SyncUrl = null;
|
||||
public string SyncUsername = "";
|
||||
public string SyncPassword = "";
|
||||
@@ -85,8 +94,17 @@ namespace Elwig.Helpers {
|
||||
Debug = TrueValues.Contains(config["general:debug"]?.ToLower());
|
||||
var weighing = config["general:weighing"];
|
||||
WeighingMode = weighing != null && Enum.TryParse<WeighingMode>(weighing, true, out var w) ? w : null;
|
||||
|
||||
BackupAuto = !FalseValues.Contains(config["backup:auto"]?.ToLower());
|
||||
BackupPath = Path.Combine(Path.GetDirectoryName(DatabaseFile) ?? App.DataPath, config["backup:path"] ?? "backups");
|
||||
BackupRetainHours = int.TryParse(config["backup:retain_hours"], out var hours) ? hours : 36;
|
||||
BackupRetainDays = int.TryParse(config["backup:retain_days"], out var days) ? days : 8;
|
||||
BackupRetainWeeks = int.TryParse(config["backup:retain_weeks"], out var weeks) ? weeks : 6;
|
||||
BackupRetainMonths = int.TryParse(config["backup:retain_months"], out var months) ? months : 18;
|
||||
|
||||
UpdateUrl = config["update:url"];
|
||||
UpdateAuto = TrueValues.Contains(config["update:auto"]?.ToLower());
|
||||
|
||||
SyncUrl = config["sync:url"];
|
||||
SyncUsername = config["sync:username"] ?? "";
|
||||
SyncPassword = config["sync:password"] ?? "";
|
||||
|
||||
Reference in New Issue
Block a user