diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-05-30 16:15:53 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-05-30 16:15:53 -0500 |
| commit | 64db0b76b4a7f3242887d81b18414b8983a0d888 (patch) | |
| tree | c5f21246ee35c7952eda02cd6f67c698196091cb | |
| parent | 012b429f11d6c0247fa90a74c0367a112d45a84c (diff) | |
| download | slskd-64db0b76b4a7f3242887d81b18414b8983a0d888.tar.gz | |
rename 'conflict' option to 'exists'
| -rw-r--r-- | config/slskd.example.yml | 2 | ||||
| -rw-r--r-- | src/slskd/Core/Options.cs | 6 | ||||
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 4 | ||||
| -rw-r--r-- | src/slskd/Transfers/Types/DestinationExistsStrategy.cs (renamed from src/slskd/Transfers/Types/DestinationConflictStrategy.cs) | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml index d295b964..b66879e3 100644 --- a/config/slskd.example.yml +++ b/config/slskd.example.yml @@ -80,7 +80,7 @@ # max_delay: 60000 # maximum time between retries, in milliseconds # destination: # subdirectory: {SOURCE_DIRECTORY} -# conflict: rename # 'overwrite' or 'rename' +# exists: rename # 'overwrite' or 'rename' # permissions: # mode: ~ # chmod syntax, e.g. 644, 777. does nothing on Windows. # groups: diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 6600cf76..4e7dca7b 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -1078,10 +1078,10 @@ namespace slskd public string Subdirectory { get; init; } = "{SOURCE_DIRECTORY}"; /// <summary> - /// Gets the strategy for handling conflicting filenames on disk. + /// Gets the strategy for handling existing files on disk. /// </summary> - [Enum(typeof(DestinationConflictStrategy))] - public string Conflict { get; init; } = DestinationConflictStrategy.Rename.ToString().ToLowerInvariant(); + [Enum(typeof(DestinationExistsStrategy))] + public string Exists { get; init; } = DestinationExistsStrategy.Rename.ToString().ToLowerInvariant(); /// <summary> /// Gets the permissions to apply to downloaded files and directories. diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index b2435669..d09bb71b 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -1323,7 +1323,7 @@ namespace slskd.Transfers.Downloads var subdirectory = await DeriveDestination(transfer); var destinationDirectory = FileSafety.CombineSafely(OptionsMonitor.CurrentValue.Directories.Downloads, subdirectory); - var conflictStrategy = OptionsMonitor.CurrentValue.Transfers.Download.Destination.Conflict.ToEnum<DestinationConflictStrategy>(); + var existsStrategy = OptionsMonitor.CurrentValue.Transfers.Download.Destination.Exists.ToEnum<DestinationExistsStrategy>(); Log.Debug("Destination directory for {Filename}: {Destination}", transfer.Filename, destinationDirectory); @@ -1331,7 +1331,7 @@ namespace slskd.Transfers.Downloads sourceFilename: incompleteFilename, destinationDirectory: destinationDirectory, unixFileMode: unixFileMode, - overwrite: conflictStrategy == DestinationConflictStrategy.Overwrite, + overwrite: existsStrategy == DestinationExistsStrategy.Overwrite, deleteSourceDirectoryIfEmptyAfterMove: true); Log.Debug("Moved file {Filename} to {Destination}", transfer.Filename, finalFilename); diff --git a/src/slskd/Transfers/Types/DestinationConflictStrategy.cs b/src/slskd/Transfers/Types/DestinationExistsStrategy.cs index 27281a2d..18837563 100644 --- a/src/slskd/Transfers/Types/DestinationConflictStrategy.cs +++ b/src/slskd/Transfers/Types/DestinationExistsStrategy.cs @@ -1,4 +1,4 @@ -// <copyright file="DestinationConflictStrategy.cs" company="JP Dillingham"> +// <copyright file="DestinationExistsStrategy.cs" company="JP Dillingham"> // ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ // ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ // █__ --█ █__ --█ ◄█ - █ @@ -33,12 +33,12 @@ namespace slskd.Transfers; /// <summary> -/// Strategy for handling downloaded files with conflicting names. +/// Strategy for handling downloaded files when the destination file already exists. /// </summary> -public enum DestinationConflictStrategy +public enum DestinationExistsStrategy { /// <summary> - /// Rename the new file by appending something. + /// Rename the new file by appending something to the file name. /// </summary> Rename = 0, |
