aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Transfers/Types
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-06-28 10:36:12 -0500
committerGitHub <noreply@github.com>2022-06-28 10:36:12 -0500
commit77df3572c381150dc60454be03ca3176a940a628 (patch)
treebd28e93414bc580fac30619a994756ad1193d99b /src/slskd/Transfers/Types
parent18e5c8dd9a98862422a46221f99a1091a9314381 (diff)
parent1d211e640b8677753be7fee06f640f43863f8e68 (diff)
downloadslskd-77df3572c381150dc60454be03ca3176a940a628.tar.gz
Merge pull request #534 from slskd/send-stats
Include upload slot and approximate queue position with search results
Diffstat (limited to 'src/slskd/Transfers/Types')
-rw-r--r--src/slskd/Transfers/Types/Upload.cs33
-rw-r--r--src/slskd/Transfers/Types/UploadGroup.cs29
2 files changed, 62 insertions, 0 deletions
diff --git a/src/slskd/Transfers/Types/Upload.cs b/src/slskd/Transfers/Types/Upload.cs
new file mode 100644
index 00000000..bc2b69b1
--- /dev/null
+++ b/src/slskd/Transfers/Types/Upload.cs
@@ -0,0 +1,33 @@
+// <copyright file="Upload.cs" company="slskd Team">
+// Copyright (c) slskd Team. All rights reserved.
+//
+// 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, either version 3 of the License, or
+// (at your option) any later version.
+//
+// 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/.
+// </copyright>
+
+namespace slskd.Transfers
+{
+ using System;
+ using System.Threading.Tasks;
+
+ public sealed class Upload
+ {
+ public DateTime Enqueued { get; set; } = DateTime.UtcNow;
+ public string Filename { get; set; }
+ public string Group { get; set; }
+ public DateTime? Ready { get; set; } = null;
+ public DateTime? Started { get; set; } = null;
+ public TaskCompletionSource TaskCompletionSource { get; set; } = new TaskCompletionSource();
+ public string Username { get; set; }
+ }
+}
diff --git a/src/slskd/Transfers/Types/UploadGroup.cs b/src/slskd/Transfers/Types/UploadGroup.cs
new file mode 100644
index 00000000..5696b0f1
--- /dev/null
+++ b/src/slskd/Transfers/Types/UploadGroup.cs
@@ -0,0 +1,29 @@
+// <copyright file="UploadGroup.cs" company="slskd Team">
+// Copyright (c) slskd Team. All rights reserved.
+//
+// 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, either version 3 of the License, or
+// (at your option) any later version.
+//
+// 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/.
+// </copyright>
+
+namespace slskd.Transfers
+{
+ public sealed class UploadGroup
+ {
+ public string Name { get; set; }
+ public int Priority { get; set; }
+ public bool SlotAvailable => UsedSlots < Slots;
+ public int Slots { get; set; }
+ public QueueStrategy Strategy { get; set; }
+ public int UsedSlots { get; set; }
+ }
+}