From b59d4b6b9b497c9c9c767e11da2af30dfd41983a Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 16 May 2026 14:54:22 -0500 Subject: add response --- .../API/DTO/QueueDownloadBatchResponse.cs | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs (limited to 'src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs') diff --git a/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs b/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs new file mode 100644 index 00000000..8e134c29 --- /dev/null +++ b/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs @@ -0,0 +1,41 @@ +// +// ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ +// ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ +// █__ --█ █__ --█ ◄█ - █ +// █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█ +// ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉ +// │ 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 +// ╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈ +// + +using System.Collections.Generic; + +namespace slskd.Transfers.API; + +public record QueueDownloadBatchResponse +{ + public Batch Batch { get; init; } + public Dictionary Failures { get; init; } = []; +} -- cgit v1.2.3 From 21167d26a62add9ba54c50faa9b93970a478d27b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 16 May 2026 18:53:38 -0500 Subject: failures as objects to avoid dictionary keys containing crap --- src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs') diff --git a/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs b/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs index 8e134c29..84b570bc 100644 --- a/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs +++ b/src/slskd/Transfers/API/DTO/QueueDownloadBatchResponse.cs @@ -37,5 +37,11 @@ namespace slskd.Transfers.API; public record QueueDownloadBatchResponse { public Batch Batch { get; init; } - public Dictionary Failures { get; init; } = []; + public IReadOnlyCollection Failures { get; init; } = []; +} + +public record QueueDownloadBatchResponseFailure +{ + public string Filename { get; init; } + public string Message { get; init; } } -- cgit v1.2.3