From c4450c8592e646de0185fd58710277a2dd0b3ebc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 13 Oct 2024 17:53:20 -0500 Subject: move script config under integration --- src/slskd/Core/Options.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 0f86ff62..306f9b87 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -32,6 +32,7 @@ namespace slskd using NetTools; using slskd.Authentication; using slskd.Configuration; + using slskd.Events; using slskd.Relay; using slskd.Shares; using slskd.Validation; @@ -2004,6 +2005,12 @@ namespace slskd /// public class IntegrationOptions { + /// + /// Gets script configuration. + /// + [Validate] + public Dictionary Scripts { get; init; } = []; + /// /// Gets FTP options. /// @@ -2016,6 +2023,25 @@ namespace slskd [Validate] public PushbulletOptions Pushbullet { get; init; } = new PushbulletOptions(); + /// + /// Script configuration. + /// + public class ScriptOptions + { + /// + /// Gets the list of Event types that trigger the script. + /// + [Enum(typeof(EventType))] + public string[] On { get; init; } = Array.Empty(); + + /// + /// Gets the shell script to invoke. + /// + [StringLength(int.MaxValue, MinimumLength = 1)] + [NotNullOrWhiteSpace] + public string Run { get; init; } + } + /// /// FTP options. /// -- cgit v1.2.3