diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-03-01 19:01:00 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-01 19:01:00 -0600 |
| commit | 4de21d94899605accdba680eeff95b8dc38b59e2 (patch) | |
| tree | 58f49ae44bbf246f686cec7bda3dff562774fa66 /src/slskd/Program.cs | |
| parent | bd3f8adf85bc5a1e6235af518de40001a25fba10 (diff) | |
| parent | 9c50ae8b5d6e9b6de3d2a3fa26ed6317f50c4433 (diff) | |
| download | slskd-4de21d94899605accdba680eeff95b8dc38b59e2.tar.gz | |
Merge pull request #1292 from slskd/scripts
Refactor user-defined scripts
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 49b01516..b7fa47d2 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -208,6 +208,11 @@ namespace slskd public static string LogDirectory { get; private set; } = null; /// <summary> + /// Gets the path where user-defined scripts are stored. + /// </summary> + public static string ScriptDirectory { get; private set; } = null; + + /// <summary> /// Gets a buffer containing the last few log events. /// </summary> public static ConcurrentFixedSizeQueue<LogRecord> LogBuffer { get; } = new ConcurrentFixedSizeQueue<LogRecord>(size: 100); @@ -332,6 +337,7 @@ namespace slskd AppDirectory ??= DefaultAppDirectory; DataDirectory = Path.Combine(AppDirectory, "data"); LogDirectory = Path.Combine(AppDirectory, "logs"); + ScriptDirectory = Path.Combine(AppDirectory, "scripts"); DefaultConfigurationFile = Path.Combine(AppDirectory, $"{AppName}.yml"); DefaultDownloadsDirectory = Path.Combine(AppDirectory, "downloads"); @@ -347,6 +353,7 @@ namespace slskd { VerifyDirectory(AppDirectory, createIfMissing: true, verifyWriteable: true); VerifyDirectory(DataDirectory, createIfMissing: true, verifyWriteable: true); + VerifyDirectory(ScriptDirectory, createIfMissing: true, verifyWriteable: false); VerifyDirectory(DefaultDownloadsDirectory, createIfMissing: true, verifyWriteable: true); VerifyDirectory(DefaultIncompleteDirectory, createIfMissing: true, verifyWriteable: true); } |
