aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-11-25 15:02:08 -0600
committerJP Dillingham <jp@dillingham.me>2022-11-25 15:02:08 -0600
commitd88e4a31f35d9197e79ff0d55ecd75085404be9a (patch)
tree5e2e7c5f7c64b80052f2f4dfb574398b685e0d54 /src/slskd/Program.cs
parentfd56f6fc0d2f1fa081c312bb5dea976b40131b94 (diff)
downloadslskd-d88e4a31f35d9197e79ff0d55ecd75085404be9a.tar.gz
add IsRelayAgent to Program, simplify checks
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 58b1252f..0b82e825 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -153,6 +153,11 @@ namespace slskd
public static bool IsDevelopment { get; } = new Version(0, 0, 0, 0) == AssemblyVersion;
/// <summary>
+ /// Gets a value indicating whether the application is being run in Relay Agent mode.
+ /// </summary>
+ public static bool IsRelayAgent { get; private set; }
+
+ /// <summary>
/// Gets the path where application data is saved.
/// </summary>
[Argument('a', "app-dir", "path where application data is saved")]
@@ -358,6 +363,8 @@ namespace slskd
return;
}
+ IsRelayAgent = OptionsAtStartup.Relay.Enabled && OptionsAtStartup.Relay.Mode.ToEnum<RelayMode>() == RelayMode.Agent;
+
ConfigureGlobalLogger();
Log = Serilog.Log.ForContext(typeof(Program));