diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-11-25 15:02:08 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-11-25 15:02:08 -0600 |
| commit | d88e4a31f35d9197e79ff0d55ecd75085404be9a (patch) | |
| tree | 5e2e7c5f7c64b80052f2f4dfb574398b685e0d54 /src/slskd/Program.cs | |
| parent | fd56f6fc0d2f1fa081c312bb5dea976b40131b94 (diff) | |
| download | slskd-d88e4a31f35d9197e79ff0d55ecd75085404be9a.tar.gz | |
add IsRelayAgent to Program, simplify checks
Diffstat (limited to 'src/slskd/Program.cs')
| -rw-r--r-- | src/slskd/Program.cs | 7 |
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)); |
