diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Types/Group.cs | 29 | ||||
| -rw-r--r-- | src/slskd/Transfers/Types/Upload.cs | 33 | ||||
| -rw-r--r-- | src/slskd/Transfers/Uploads/UploadQueue.cs | 21 |
3 files changed, 62 insertions, 21 deletions
diff --git a/src/slskd/Transfers/Types/Group.cs b/src/slskd/Transfers/Types/Group.cs new file mode 100644 index 00000000..c01e4f8a --- /dev/null +++ b/src/slskd/Transfers/Types/Group.cs @@ -0,0 +1,29 @@ +// <copyright file="Group.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 Group + { + 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; } + } +} 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/Uploads/UploadQueue.cs b/src/slskd/Transfers/Uploads/UploadQueue.cs index 1e732674..77eb7758 100644 --- a/src/slskd/Transfers/Uploads/UploadQueue.cs +++ b/src/slskd/Transfers/Uploads/UploadQueue.cs @@ -467,26 +467,5 @@ namespace slskd.Transfers SyncRoot.Release(); } } - - public sealed class Group - { - 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; } - } - - 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; } - } } }
\ No newline at end of file |
