diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-05-14 14:34:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-14 14:34:46 -0500 |
| commit | e22472791be56eb3b44d7af7064400aa5e6ef9fc (patch) | |
| tree | 8b6629c2a81de5889a0084a8f12d5c73b0cfdf36 /src/slskd/Options.cs | |
| parent | 5926fd44420da613b4c4c00d043151916f24b989 (diff) | |
| parent | a0458827d19f21fe3efe40b5630bc18d0e28fd38 (diff) | |
| download | slskd-e22472791be56eb3b44d7af7064400aa5e6ef9fc.tar.gz | |
Merge pull request #70 from slskd/incomplete-downloads
Save incomplete downloads in a separate directory
Diffstat (limited to 'src/slskd/Options.cs')
| -rw-r--r-- | src/slskd/Options.cs | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 527cfc42..6074d650 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -127,13 +127,20 @@ namespace slskd public class DirectoriesOptions { /// <summary> - /// Gets the path to shared files. + /// Gets the path where application data is saved. /// </summary> - [Argument('s', "shared")] - [EnvironmentVariable("SHARED_DIR")] - [Description("path to shared files")] - [Required] - public string Shared { get; private set; } = null; + [Argument(default, "app")] + [EnvironmentVariable("APP_DIR")] + [Description("path where application data is saved")] + public string App { get; private set; } = Program.DefaultAppDirectory; + + /// <summary> + /// Gets the path where incomplete downloads are saved. + /// </summary> + [Argument(default, "incomplete")] + [EnvironmentVariable("INCOMPLETE_DIR")] + [Description("path where incomplete downloads are saved")] + public string Incomplete { get; private set; } = Program.DefaultIncompleteDirectory; /// <summary> /// Gets the path where downloaded files are saved. @@ -141,8 +148,15 @@ namespace slskd [Argument('o', "downloads")] [EnvironmentVariable("DOWNLOADS_DIR")] [Description("path where downloaded files are saved")] - [Required] - public string Downloads { get; private set; } = null; + public string Downloads { get; private set; } = Program.DefaultDownloadsDirectory; + + /// <summary> + /// Gets the path to shared files. + /// </summary> + [Argument('s', "shared")] + [EnvironmentVariable("SHARED_DIR")] + [Description("path to shared files")] + public string Shared { get; private set; } = Program.DefaultSharedDirectory; } /// <summary> @@ -357,7 +371,7 @@ namespace slskd [Argument(default, "content-path")] [EnvironmentVariable("CONTENT_PATH")] [Description("path to static web content")] - [Required] + [StringLength(255, MinimumLength = 1)] public string ContentPath { get; private set; } = "wwwroot"; /// <summary> @@ -385,7 +399,7 @@ namespace slskd [Argument('u', "username")] [EnvironmentVariable("USERNAME")] [Description("username for web UI")] - [Required] + [StringLength(255, MinimumLength = 1)] public string Username { get; private set; } = Program.AppName; /// <summary> @@ -394,7 +408,7 @@ namespace slskd [Argument('p', "password")] [EnvironmentVariable("PASSWORD")] [Description("password for web UI")] - [Required] + [StringLength(255, MinimumLength = 1)] public string Password { get; private set; } = Program.AppName; /// <summary> @@ -414,7 +428,7 @@ namespace slskd [Argument(default, "jwt-key")] [EnvironmentVariable("JWT_KEY")] [Description("JWT signing key")] - [Required] + [StringLength(255, MinimumLength = 1)] public string Key { get; private set; } = Guid.NewGuid().ToString(); /// <summary> |
