diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-05-04 22:13:44 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-05-04 22:13:44 -0500 |
| commit | 16aeb34e118ee2d4770bcace3aa06a7615a2eae6 (patch) | |
| tree | d755f27134c22b33ac675b376fcd6f5c5fa441ac /src/slskd/Transfers/API/DTO/QueueDownloadBatchRequest.cs | |
| parent | 8508606e16aa5ed00ca9d3e19d85e576e383aa63 (diff) | |
| download | slskd-16aeb34e118ee2d4770bcace3aa06a7615a2eae6.tar.gz | |
tweak dto
Diffstat (limited to 'src/slskd/Transfers/API/DTO/QueueDownloadBatchRequest.cs')
| -rw-r--r-- | src/slskd/Transfers/API/DTO/QueueDownloadBatchRequest.cs | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/slskd/Transfers/API/DTO/QueueDownloadBatchRequest.cs b/src/slskd/Transfers/API/DTO/QueueDownloadBatchRequest.cs new file mode 100644 index 00000000..0aaf1034 --- /dev/null +++ b/src/slskd/Transfers/API/DTO/QueueDownloadBatchRequest.cs @@ -0,0 +1,93 @@ +// <copyright file="QueueDownloadBatchRequest.cs" company="JP Dillingham"> +// ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ +// ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ +// █__ --█ █__ --█ ◄█ - █ +// █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█ +// ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉ +// │ 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 +// ╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈ +// </copyright> + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace slskd.Transfers.API; + +public record QueueDownloadBatchRequest +{ + /// <summary> + /// The ID of the Batch. + /// </summary> + /// <remarks> + /// If not supplied, one will be randomly generated. + /// </remarks> + public Guid? Id { get; init; } = Guid.NewGuid(); + + /// <summary> + /// The ID of the associated Search, if applicable. + /// </summary> + public Guid? SearchId { get; init; } + + /// <summary> + /// The username of the user from which to download. + /// </summary> + [Required] + [StringLength(500, MinimumLength = 1)] + public string Username { get; init; } + + /// <summary> + /// The list of files to download. + /// </summary> + public List<EnqueueDownloadBatchItem> Files { get; init; } = []; + + /// <summary> + /// Options for the Batch. + /// </summary> + public EnqueueDownloadBatchOptions Options { get; init; } = new(); +} + +public record EnqueueDownloadBatchItem +{ + /// <summary> + /// The name of the file. + /// </summary> + [Required] + public string Filename { get; set; } + + /// <summary> + /// The file size. + /// </summary> + [Range(0, int.MaxValue)] + public long Size { get; set; } +} + +public record EnqueueDownloadBatchOptions +{ + /// <summary> + /// The destination directory for the files, relative to the configured download directory. + /// </summary> + public string Destination { get; init; } +}
\ No newline at end of file |
