From c03c5087aa6ac70491363b7dff05909f7bc64fe0 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 24 May 2026 12:52:16 -0500 Subject: rename 'incomplete' to 'partial', default to 'resume' (to match docs) --- src/slskd/Core/Options.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 83e534a1..bac86ea2 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -1052,10 +1052,10 @@ namespace slskd public int MaxDelay { get; init; } = 60_000; /// - /// Gets the strategy for handling incomplete files upon retry. + /// Gets the strategy for handling partial files upon retry. /// - [Enum(typeof(RetryIncompleteStrategy))] - public string Incomplete { get; init; } = RetryIncompleteStrategy.Overwrite.ToString().ToLowerInvariant(); + [Enum(typeof(RetryPartialStrategy))] + public string Partial { get; init; } = RetryPartialStrategy.Resume.ToString().ToLowerInvariant(); } } -- cgit v1.2.3 From 8b27a264869dd51f3bb1ae27f208a3843d4c7df0 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 24 May 2026 12:54:00 -0500 Subject: rename RetryIncompleteStrategy to RetryPartialStrategy --- .../Transfers/Types/RetryIncompleteStrategy.cs | 49 ---------------------- src/slskd/Transfers/Types/RetryPartialStrategy.cs | 49 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 src/slskd/Transfers/Types/RetryIncompleteStrategy.cs create mode 100644 src/slskd/Transfers/Types/RetryPartialStrategy.cs (limited to 'src') diff --git a/src/slskd/Transfers/Types/RetryIncompleteStrategy.cs b/src/slskd/Transfers/Types/RetryIncompleteStrategy.cs deleted file mode 100644 index 9ac8d8e2..00000000 --- a/src/slskd/Transfers/Types/RetryIncompleteStrategy.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ -// ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ -// █__ --█ █__ --█ ◄█ - █ -// █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█ -// ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉ -// │ Copyright (c) JP Dillingham. -// │ -// │ This program is free software: you can redistribute it and/or modify -// │ it under the terms of the GNU Affero General Public License as published -// │ by the Free Software Foundation, version 3. -// │ -// │ This program is distributed in the hope that it will be useful, -// │ but WITHOUT ANY WARRANTY; without even the implied warranty of -// │ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// │ GNU Affero General Public License for more details. -// │ -// │ You should have received a copy of the GNU Affero General Public License -// │ along with this program. If not, see https://www.gnu.org/licenses/. -// │ -// │ This program is distributed with Additional Terms pursuant to Section 7 -// │ of the AGPLv3. See the LICENSE file in the root directory of this -// │ project for the complete terms and conditions. -// │ -// │ https://slskd.org -// │ -// ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ╌ ╌╌╌╌ ╌ -// │ SPDX-FileCopyrightText: JP Dillingham -// │ SPDX-License-Identifier: AGPL-3.0-only -// ╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈ -// - -namespace slskd.Transfers; - -/// -/// Strategy for retrying incomplete files. -/// -public enum RetryIncompleteStrategy -{ - /// - /// Overwrite the existing file. - /// - Overwrite = 0, - - /// - /// Resume the transfer using the size of the incomplete file as the initial offset. - /// - Resume = 1, -} \ No newline at end of file diff --git a/src/slskd/Transfers/Types/RetryPartialStrategy.cs b/src/slskd/Transfers/Types/RetryPartialStrategy.cs new file mode 100644 index 00000000..20868913 --- /dev/null +++ b/src/slskd/Transfers/Types/RetryPartialStrategy.cs @@ -0,0 +1,49 @@ +// +// ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ +// ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ +// █__ --█ █__ --█ ◄█ - █ +// █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█ +// ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉ +// │ Copyright (c) JP Dillingham. +// │ +// │ This program is free software: you can redistribute it and/or modify +// │ it under the terms of the GNU Affero General Public License as published +// │ by the Free Software Foundation, version 3. +// │ +// │ This program is distributed in the hope that it will be useful, +// │ but WITHOUT ANY WARRANTY; without even the implied warranty of +// │ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// │ GNU Affero General Public License for more details. +// │ +// │ You should have received a copy of the GNU Affero General Public License +// │ along with this program. If not, see https://www.gnu.org/licenses/. +// │ +// │ This program is distributed with Additional Terms pursuant to Section 7 +// │ of the AGPLv3. See the LICENSE file in the root directory of this +// │ project for the complete terms and conditions. +// │ +// │ https://slskd.org +// │ +// ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ╌ ╌╌╌╌ ╌ +// │ SPDX-FileCopyrightText: JP Dillingham +// │ SPDX-License-Identifier: AGPL-3.0-only +// ╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈ +// + +namespace slskd.Transfers; + +/// +/// Strategy for retrying partial files. +/// +public enum RetryPartialStrategy +{ + /// + /// Overwrite the existing file. + /// + Overwrite = 0, + + /// + /// Resume the transfer using the size of the partial file as the initial offset. + /// + Resume = 1, +} \ No newline at end of file -- cgit v1.2.3 From 98b81975d0bf7a10fc834d33d5bfbb6532f75686 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 24 May 2026 13:10:02 -0500 Subject: update partial call sites --- src/slskd/Transfers/Downloads/DownloadService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 83e91ced..013e6a7a 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -1061,14 +1061,14 @@ namespace slskd.Transfers.Downloads var completedTransfer = await Retry.Do(() => { var incompleteFileInfo = Files.ResolveFileInfo(incompleteFilename); - var incompleteStrategy = retryOptions.Incomplete.ToEnum(); + var incompleteStrategy = retryOptions.Partial.ToEnum(); var shouldResume = false; var startOffset = 0L; if (incompleteFileInfo.Exists && incompleteFileInfo.Length > 0) { - if (incompleteStrategy == RetryIncompleteStrategy.Resume) + if (incompleteStrategy == RetryPartialStrategy.Resume) { shouldResume = true; startOffset = incompleteFileInfo.Length; -- cgit v1.2.3