From d88e4a31f35d9197e79ff0d55ecd75085404be9a Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 25 Nov 2022 15:02:08 -0600 Subject: add IsRelayAgent to Program, simplify checks --- src/slskd/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/slskd/Program.cs') 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 @@ -152,6 +152,11 @@ namespace slskd /// public static bool IsDevelopment { get; } = new Version(0, 0, 0, 0) == AssemblyVersion; + /// + /// Gets a value indicating whether the application is being run in Relay Agent mode. + /// + public static bool IsRelayAgent { get; private set; } + /// /// Gets the path where application data is saved. /// @@ -358,6 +363,8 @@ namespace slskd return; } + IsRelayAgent = OptionsAtStartup.Relay.Enabled && OptionsAtStartup.Relay.Mode.ToEnum() == RelayMode.Agent; + ConfigureGlobalLogger(); Log = Serilog.Log.ForContext(typeof(Program)); -- cgit v1.2.3