aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-09-10 12:40:03 -0500
committerGitHub <noreply@github.com>2022-09-10 12:40:03 -0500
commit3d657ed87cfdab4089c72d9e6532d9b2cc83aa4e (patch)
tree848ead506fa36e922bf9db2d3f45f6398fdac8b8 /src/slskd/Core
parent25191b8b7c8fa08484e2b7eb4efe4a1398cb1ab5 (diff)
parent1955793824df698ce1f4aa3a130d327e20875efd (diff)
downloadslskd-3d657ed87cfdab4089c72d9e6532d9b2cc83aa4e.tar.gz
Merge pull request #637 from slskd/db-metadata
Refactor shared file cache to store all data on disk
Diffstat (limited to 'src/slskd/Core')
-rw-r--r--src/slskd/Core/ConnectionStrings.cs29
-rw-r--r--src/slskd/Core/Filenames.cs30
-rw-r--r--src/slskd/Core/Options.cs8
-rw-r--r--src/slskd/Core/State.cs1
4 files changed, 64 insertions, 4 deletions
diff --git a/src/slskd/Core/ConnectionStrings.cs b/src/slskd/Core/ConnectionStrings.cs
new file mode 100644
index 00000000..e5bd4f05
--- /dev/null
+++ b/src/slskd/Core/ConnectionStrings.cs
@@ -0,0 +1,29 @@
+// <copyright file="ConnectionStrings.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
+{
+ /// <summary>
+ /// Application connection strings.
+ /// </summary>
+ public record ConnectionStrings
+ {
+ public string Transfers { get; init; }
+ public string Shares { get; init; }
+ public string Search { get; init; }
+ }
+}
diff --git a/src/slskd/Core/Filenames.cs b/src/slskd/Core/Filenames.cs
new file mode 100644
index 00000000..0fc55fc5
--- /dev/null
+++ b/src/slskd/Core/Filenames.cs
@@ -0,0 +1,30 @@
+// <copyright file="Filenames.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
+{
+ /// <summary>
+ /// Application files.
+ /// </summary>
+ public static class Filenames
+ {
+ public static readonly string TransfersDb = "transfers.db";
+ public static readonly string SharesDb = "shares.db";
+ public static readonly string SearchDb = "search.db";
+ public static readonly string BrowseCache = "browse.cache";
+ }
+}
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 259977b6..d6d4b04c 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -755,12 +755,12 @@ namespace slskd
/// Gets metrics endpoint authentication options.
/// </summary>
[Validate]
- public AuthenticationOptions Authentication { get; init; } = new AuthenticationOptions();
+ public MetricsAuthenticationOptions Authentication { get; init; } = new MetricsAuthenticationOptions();
/// <summary>
/// Metrics endpoint authentication options.
/// </summary>
- public class AuthenticationOptions
+ public class MetricsAuthenticationOptions
{
/// <summary>
/// Gets a value indicating whether authentication should be disabled.
@@ -1114,12 +1114,12 @@ namespace slskd
/// Gets authentication options.
/// </summary>
[Validate]
- public AuthenticationOptions Authentication { get; init; } = new AuthenticationOptions();
+ public WebAuthenticationOptions Authentication { get; init; } = new WebAuthenticationOptions();
/// <summary>
/// Authentication options.
/// </summary>
- public class AuthenticationOptions
+ public class WebAuthenticationOptions
{
/// <summary>
/// Gets a value indicating whether authentication should be disabled.
diff --git a/src/slskd/Core/State.cs b/src/slskd/Core/State.cs
index a1da2be8..1b798ad3 100644
--- a/src/slskd/Core/State.cs
+++ b/src/slskd/Core/State.cs
@@ -102,6 +102,7 @@ namespace slskd
{
public bool ScanPending { get; init; }
public bool Scanning { get; init; }
+ public bool Ready { get; init; }
public bool Faulted { get; init; }
public double ScanProgress { get; init; }
public int Directories { get; init; }