aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-10-15 15:36:19 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-10-15 15:36:19 -0500
commit8d0799dc956b6c5b1473e010cdf0e6566e10c72c (patch)
tree9486b2926e3058cb967a0234a086c4b22f0a2606 /src
parent465ee43f9e95e9e98b9e039392c94ad92e7f6416 (diff)
downloadslskd-8d0799dc956b6c5b1473e010cdf0e6566e10c72c.tar.gz
simplify Host
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Shares/Types/Host.cs18
-rw-r--r--src/slskd/Shares/Types/HostState.cs35
-rw-r--r--src/slskd/Shares/Types/HostType.cs35
3 files changed, 2 insertions, 86 deletions
diff --git a/src/slskd/Shares/Types/Host.cs b/src/slskd/Shares/Types/Host.cs
index 3c5c9f9f..50302480 100644
--- a/src/slskd/Shares/Types/Host.cs
+++ b/src/slskd/Shares/Types/Host.cs
@@ -29,36 +29,22 @@ 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, HostType type, IEnumerable<Share> shares = null, HostState state = HostState.Offline)
+ public Host(string name, IEnumerable<Share> shares = null)
{
Name = name;
- Type = type;
Shares = shares ?? Enumerable.Empty<Share>();
- State = state;
}
/// <summary>
/// Gets the name of the host.
/// </summary>
- /// <remarks>Corresponds to the configured <see cref="Options.InstanceName"/> of the host.</remarks>
+ /// <remarks>Corresponds to the configured <see cref="Options.InstanceName"/> of the host, or "local" for the local host.</remarks>
public string Name { get; }
/// <summary>
/// Gets the collection of hosted shares.
/// </summary>
public IEnumerable<Share> Shares { get; init; }
-
- /// <summary>
- /// Gets the host state.
- /// </summary>
- public HostState State { get; init; }
-
- /// <summary>
- /// Gets the host type.
- /// </summary>
- public HostType Type { get; }
}
} \ No newline at end of file
diff --git a/src/slskd/Shares/Types/HostState.cs b/src/slskd/Shares/Types/HostState.cs
deleted file mode 100644
index b10074d3..00000000
--- a/src/slskd/Shares/Types/HostState.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// <copyright file="HostState.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 state of a share host.
- /// </summary>
- public enum HostState
- {
- /// <summary>
- /// Offline; unable to service requests.
- /// </summary>
- Offline = 0,
-
- /// <summary>
- /// Online; able to service requests.
- /// </summary>
- Online = 1,
- }
-}
diff --git a/src/slskd/Shares/Types/HostType.cs b/src/slskd/Shares/Types/HostType.cs
deleted file mode 100644
index 6a892dff..00000000
--- a/src/slskd/Shares/Types/HostType.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// <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,
- }
-}