aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-10-13 17:53:20 -0500
committerJP Dillingham <jp@dillingham.me>2024-10-13 17:53:20 -0500
commitc4450c8592e646de0185fd58710277a2dd0b3ebc (patch)
tree879c443ce8def6d7c5f3df4ce2f01bb95c9507f6 /src
parent8400410fbbc81cea8140da79b3bb991c3bacd87c (diff)
downloadslskd-c4450c8592e646de0185fd58710277a2dd0b3ebc.tar.gz
move script config under integration
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Options.cs26
1 files changed, 26 insertions, 0 deletions
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;
@@ -2005,6 +2006,12 @@ namespace slskd
public class IntegrationOptions
{
/// <summary>
+ /// Gets script configuration.
+ /// </summary>
+ [Validate]
+ public Dictionary<string, ScriptOptions> Scripts { get; init; } = [];
+
+ /// <summary>
/// Gets FTP options.
/// </summary>
[Validate]
@@ -2017,6 +2024,25 @@ namespace slskd
public PushbulletOptions Pushbullet { get; init; } = new PushbulletOptions();
/// <summary>
+ /// Script configuration.
+ /// </summary>
+ public class ScriptOptions
+ {
+ /// <summary>
+ /// Gets the list of Event types that trigger the script.
+ /// </summary>
+ [Enum(typeof(EventType))]
+ public string[] On { get; init; } = Array.Empty<string>();
+
+ /// <summary>
+ /// Gets the shell script to invoke.
+ /// </summary>
+ [StringLength(int.MaxValue, MinimumLength = 1)]
+ [NotNullOrWhiteSpace]
+ public string Run { get; init; }
+ }
+
+ /// <summary>
/// FTP options.
/// </summary>
public class FtpOptions : IValidatableObject