aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-10-13 10:46:00 -0500
committerJP Dillingham <jp@dillingham.me>2022-10-13 10:46:00 -0500
commitd601ae74def72dbef7baa73c8c45390b186f61c8 (patch)
tree396c406a8f0587c1f8171c923f0e71457f58ade9 /src
parent43c19eac0b258c852fc10d017daf1ee010f8cdcc (diff)
downloadslskd-d601ae74def72dbef7baa73c8c45390b186f61c8.tar.gz
add HostType
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Shares/Types/Host.cs9
-rw-r--r--src/slskd/Shares/Types/HostType.cs35
2 files changed, 43 insertions, 1 deletions
diff --git a/src/slskd/Shares/Types/Host.cs b/src/slskd/Shares/Types/Host.cs
index 45706b23..db68c48e 100644
--- a/src/slskd/Shares/Types/Host.cs
+++ b/src/slskd/Shares/Types/Host.cs
@@ -29,11 +29,13 @@ namespace slskd.Shares
/// Initializes a new instance of the <see cref="Host"/> class.
/// </summary>
/// <param name="name">The name of the host.</param>
+ /// <param name="type">The type of the host.</param>
/// <param name="shares">The collection of hosted shares.</param>
/// <param name="state">The initial state of the host.</param>
- public Host(string name, IEnumerable<Share> shares = null, HostState state = HostState.Offline)
+ public Host(string name, HostType type, IEnumerable<Share> shares = null, HostState state = HostState.Offline)
{
Name = name;
+ Type = type;
Shares = shares ?? Enumerable.Empty<Share>();
State = state;
}
@@ -55,6 +57,11 @@ namespace slskd.Shares
public HostState State { get; private set; }
/// <summary>
+ /// Gets the host type.
+ /// </summary>
+ public HostType Type { get; }
+
+ /// <summary>
/// Sets the hosted shares for the host.
/// </summary>
/// <param name="shares">The collection of shares.</param>
diff --git a/src/slskd/Shares/Types/HostType.cs b/src/slskd/Shares/Types/HostType.cs
new file mode 100644
index 00000000..6a892dff
--- /dev/null
+++ b/src/slskd/Shares/Types/HostType.cs
@@ -0,0 +1,35 @@
+// <copyright file="HostType.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.Shares
+{
+ /// <summary>
+ /// The type of host.
+ /// </summary>
+ public enum HostType
+ {
+ /// <summary>
+ /// Local.
+ /// </summary>
+ Local = 0,
+
+ /// <summary>
+ /// Remote; shares are hosted by an Agent.
+ /// </summary>
+ Remote = 1,
+ }
+}