From 8ab0cda52fda8b7e4f0353065c6f0dc5caeeb1f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:33:53 +0000 Subject: Bump http-proxy-middleware from 2.0.6 to 2.0.9 in /src/web Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.9. - [Release notes](https://github.com/chimurai/http-proxy-middleware/releases) - [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.9/CHANGELOG.md) - [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.9) --- updated-dependencies: - dependency-name: http-proxy-middleware dependency-version: 2.0.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- src/web/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/web/package-lock.json b/src/web/package-lock.json index a6c3b7e0..4a188bfd 100644 --- a/src/web/package-lock.json +++ b/src/web/package-lock.json @@ -11796,10 +11796,11 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", - "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", + "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/http-proxy": "^1.17.8", "http-proxy": "^1.18.1", -- cgit v1.2.3 From 99d510d1d3fe4daf9e2ada01432e6fd68b3a1c96 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 19 Jun 2025 12:28:34 -0500 Subject: bump Soulseek.NET to 7.1.0 --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index cfb39234..b136b728 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From be947ef10e44d96ff795a312da4d6f7ea10bad68 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 19 Jun 2025 19:27:58 -0500 Subject: tweak logging of diagnostics --- src/slskd/Application.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index e0570ef6..6ed8a9d4 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -808,8 +808,9 @@ namespace slskd { static LogEventLevel TranslateLogLevel(DiagnosticLevel diagnosticLevel) => diagnosticLevel switch { + DiagnosticLevel.Trace => LogEventLevel.Verbose, DiagnosticLevel.Debug => LogEventLevel.Debug, - DiagnosticLevel.Info => LogEventLevel.Debug, + DiagnosticLevel.Info => LogEventLevel.Information, DiagnosticLevel.Warning => LogEventLevel.Warning, DiagnosticLevel.None => default, _ => default, -- cgit v1.2.3 From 3d7b89592b12b2d98ec2f8360511ad2f9e5099e6 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 28 Jun 2025 17:10:51 -0500 Subject: move json serialization options and logic into WebhookService to guard against regressions --- src/slskd/Integrations/Webhooks/WebhookService.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/slskd/Integrations/Webhooks/WebhookService.cs b/src/slskd/Integrations/Webhooks/WebhookService.cs index 62f097b7..b08b0484 100644 --- a/src/slskd/Integrations/Webhooks/WebhookService.cs +++ b/src/slskd/Integrations/Webhooks/WebhookService.cs @@ -25,6 +25,9 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Text; +using System.Text.Encodings.Web; +using System.Text.Json; +using System.Text.Json.Serialization; using System.Threading.Tasks; using Serilog; using slskd.Events; @@ -40,6 +43,15 @@ public class WebhookService OptionsMonitor = optionsMonitor; HttpClientFactory = httpClientFactory; + var json = new JsonSerializerOptions(); + json.Converters.Add(new IPAddressConverter()); + json.Converters.Add(new JsonStringEnumConverter()); + json.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; + json.DefaultIgnoreCondition = JsonIgnoreCondition.Never; // include properties with null values + json.Encoder = JavaScriptEncoder.Default; // IMPORTANT! don't change this to 'UnsafeRelaxedJsonEscaping'; as the name implies, it's unsafe! + + JsonSerializerOptions = json; + Events.Subscribe(nameof(WebhookService), HandleEvent); Log.Debug("{Service} initialized", nameof(WebhookService)); @@ -49,6 +61,7 @@ public class WebhookService private IOptionsMonitor OptionsMonitor { get; } private EventBus Events { get; } private IHttpClientFactory HttpClientFactory { get; } + private JsonSerializerOptions JsonSerializerOptions { get; } private async Task HandleEvent(Event data) { @@ -80,7 +93,10 @@ public class WebhookService http.DefaultRequestHeaders.TryAddWithoutValidation(header.Name, header.Value); } - var content = new StringContent(data.ToJson(), Encoding.UTF8, "application/json"); + var content = new StringContent( + content: JsonSerializer.Serialize(data, JsonSerializerOptions), + encoding: Encoding.UTF8, + mediaType: "application/json"); HttpStatusCode? statusCode = null; -- cgit v1.2.3 From df331ce2f881aa89920c004eafcfd327c91b66f0 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 4 Jul 2025 18:52:50 -0500 Subject: docs --- docs/config.md | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/config.md b/docs/config.md index cf7fb9a3..ff3e8410 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1033,11 +1033,23 @@ integration: ### Scripts -User-defined scripts can be configured to run when application events are raised. Scripts are given a name (useful for troubleshooting!), a list of triggering events, and a `run` command that's used to execute the script. +User-defined scripts can be configured to run when application events are raised. Scripts are given a name (useful for troubleshooting!), a list of triggering events, and a `run` configuration that's used to execute the script. -The `run` command must be at least one word, with the first word identifying the executable to run and the rest of the string being the command and arguments that will be passed to the executable when the script is run. The executable needs to be on the system's PATH, otherwise it must be the fully qualified path to the file on disk. +The `run` configuration can take a few different forms (see examples below), but in all cases a new process is started using either the `executable` you specify or, if you don't specify one, the executable set in your system's `$SHELL` environment variable, or `cmd.exe` on Windows. -A reserved placeholder value `$DATA` is replaced with the stringified JSON data associated with the event that caused the script to run. It's the responsibility of the script to parse and handle this JSON. +Processes are started in the `/scripts` directory (meaning the working directory), and stdout and stderr are redirected to slskd for logging purposes. Depending on the `run` configuration your defined command will be passed as either a single argument or list of arguments, with the latter being easier to properly quote and escape. + +The data associated with the event that's invoking your script is stringified to JSON and set as the value of the `SLSKD_SCRIPT_DATA` environment variable. Whatever command or script you specify will need to read this value and handle the data. + +> [!DANGER] +> **Remote Code Execution Risk**: The event data in `$SLSKD_SCRIPT_DATA` originates from the Soulseek network and may contain malicious content. Passing this data as command-line arguments could allow attackers to inject shell commands through specially crafted filenames, usernames, or other fields. For example, a filename like `song"; rm -rf /; echo "` could delete your entire filesystem if passed unsafely to a shell command. +> +> **Safe practices:** +> - ✅ Read `$SLSKD_SCRIPT_DATA` as an environment variable +> - ✅ Parse the JSON and validate/sanitize individual fields before use +> - ✅ Use programming languages with proper JSON parsing (Python, Node.js, etc.) +> - ❌ Avoid using `$SLSKD_SCRIPT_DATA` in shell command substitution like `$(echo $SLSKD_SCRIPT_DATA)` +> - ❌ Avoid passing the raw data as arguments: `my_script.sh "$SLSKD_SCRIPT_DATA"` #### **YAML** ```yaml @@ -1047,11 +1059,22 @@ integration: on: - DownloadFileComplete - DownloadDirectoryComplete - run: /bin/sh data/my_script.sh --json-to-process "$DATA" # Linux/macOS + run: + command: "echo "new event!" >> event_log.txt # command is run with system $SHELL/cmd.exe on Windows my_logging_script: on: - - All - run: cmd.exe echo $DATA >> event_log.txt # Windows + - All + run: + executable: /bin/sh # explicitly setting executable; if omitted, $SHELL/cmd.exe is used + args: '-c "echo "new event!" >> event_log.txt"' + another_script: + on: + - All + run: + executable: /bin/sh # as above, can omit to use $SHELL/cmd.exe + arglist: # easier to properly quote + - /c + - 'echo "new event!" >> event_log.txt' ``` ## System-Defined -- cgit v1.2.3 From f68455f5560b983d0fe330be09de42aa29e3f5be Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 4 Jul 2025 19:04:16 -0500 Subject: tweak --- docs/config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config.md b/docs/config.md index ff3e8410..6f01c2af 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1041,10 +1041,10 @@ Processes are started in the `/scripts` directory (meaning the working directory The data associated with the event that's invoking your script is stringified to JSON and set as the value of the `SLSKD_SCRIPT_DATA` environment variable. Whatever command or script you specify will need to read this value and handle the data. -> [!DANGER] +> [!CAUTION] > **Remote Code Execution Risk**: The event data in `$SLSKD_SCRIPT_DATA` originates from the Soulseek network and may contain malicious content. Passing this data as command-line arguments could allow attackers to inject shell commands through specially crafted filenames, usernames, or other fields. For example, a filename like `song"; rm -rf /; echo "` could delete your entire filesystem if passed unsafely to a shell command. > -> **Safe practices:** +> **Best practices:** > - ✅ Read `$SLSKD_SCRIPT_DATA` as an environment variable > - ✅ Parse the JSON and validate/sanitize individual fields before use > - ✅ Use programming languages with proper JSON parsing (Python, Node.js, etc.) -- cgit v1.2.3 From 500573a450e5420a55196fcbf4897fb2bece69dc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 4 Jul 2025 19:07:19 -0500 Subject: move serializer options for scripts --- src/slskd/Integrations/Scripts/ScriptService.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/slskd/Integrations/Scripts/ScriptService.cs b/src/slskd/Integrations/Scripts/ScriptService.cs index 05769a6d..109cf5ff 100644 --- a/src/slskd/Integrations/Scripts/ScriptService.cs +++ b/src/slskd/Integrations/Scripts/ScriptService.cs @@ -22,6 +22,9 @@ namespace slskd.Integrations.Scripts; using System; using System.Diagnostics; using System.Linq; +using System.Text.Encodings.Web; +using System.Text.Json; +using System.Text.Json.Serialization; using System.Text.RegularExpressions; using System.Threading.Tasks; using Serilog; @@ -37,6 +40,15 @@ public class ScriptService Events = eventBus; OptionsMonitor = optionsMonitor; + var json = new JsonSerializerOptions(); + json.Converters.Add(new IPAddressConverter()); + json.Converters.Add(new JsonStringEnumConverter()); + json.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; + json.DefaultIgnoreCondition = JsonIgnoreCondition.Never; // include properties with null values + json.Encoder = JavaScriptEncoder.Default; // IMPORTANT! don't change this to 'UnsafeRelaxedJsonEscaping'; as the name implies, it's unsafe! + + JsonSerializerOptions = json; + Events.Subscribe(nameof(ScriptService), HandleEvent); if (OperatingSystem.IsWindows()) @@ -64,6 +76,7 @@ public class ScriptService private EventBus Events { get; } private string DefaultExecutable { get; } private string DefaultCommandPrefix { get; } + private JsonSerializerOptions JsonSerializerOptions { get; } private async Task HandleEvent(Event data) { @@ -167,7 +180,7 @@ public class ScriptService Log.Debug("Running script '{Script}': \"{Executable}\" {Args} (id: {ProcessId})", script.Key, executable, run.Args ?? string.Join(' ', run.Arglist ?? []), processId); var sw = Stopwatch.StartNew(); - process.StartInfo.EnvironmentVariables["SLSKD_SCRIPT_DATA"] = data.ToJson(); + process.StartInfo.EnvironmentVariables["SLSKD_SCRIPT_DATA"] = JsonSerializer.Serialize(data, JsonSerializerOptions); process.Start(); process.WaitForExit(); -- cgit v1.2.3 From 537f9363b966f2b183c7b312c1299dba1c78bab8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 6 Jul 2025 16:15:40 -0500 Subject: fix regression in scripts and webhooks causing json to be missing detail --- src/slskd/Integrations/Scripts/ScriptService.cs | 6 +++++- src/slskd/Integrations/Webhooks/WebhookService.cs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/slskd/Integrations/Scripts/ScriptService.cs b/src/slskd/Integrations/Scripts/ScriptService.cs index 109cf5ff..f5cc4d4c 100644 --- a/src/slskd/Integrations/Scripts/ScriptService.cs +++ b/src/slskd/Integrations/Scripts/ScriptService.cs @@ -180,7 +180,11 @@ public class ScriptService Log.Debug("Running script '{Script}': \"{Executable}\" {Args} (id: {ProcessId})", script.Key, executable, run.Args ?? string.Join(' ', run.Arglist ?? []), processId); var sw = Stopwatch.StartNew(); - process.StartInfo.EnvironmentVariables["SLSKD_SCRIPT_DATA"] = JsonSerializer.Serialize(data, JsonSerializerOptions); + process.StartInfo.EnvironmentVariables["SLSKD_SCRIPT_DATA"] = JsonSerializer.Serialize( + value: data, + inputType: data.GetType(), // if omitted object is serialized as EventType, losing everything else + options: JsonSerializerOptions); + process.Start(); process.WaitForExit(); diff --git a/src/slskd/Integrations/Webhooks/WebhookService.cs b/src/slskd/Integrations/Webhooks/WebhookService.cs index b08b0484..62739d7a 100644 --- a/src/slskd/Integrations/Webhooks/WebhookService.cs +++ b/src/slskd/Integrations/Webhooks/WebhookService.cs @@ -94,7 +94,10 @@ public class WebhookService } var content = new StringContent( - content: JsonSerializer.Serialize(data, JsonSerializerOptions), + content: JsonSerializer.Serialize( + value: data, + inputType: data.GetType(), // if omitted object is serialized as EventType, losing everything else + options: JsonSerializerOptions), encoding: Encoding.UTF8, mediaType: "application/json"); -- cgit v1.2.3 From 6a8c774a0572c1abbf48886fff6d30b89fc4db90 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 6 Jul 2025 18:43:19 -0500 Subject: add indexes on state and direction --- src/slskd/Transfers/TransfersDbContext.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/slskd/Transfers/TransfersDbContext.cs b/src/slskd/Transfers/TransfersDbContext.cs index cd721539..ea138bcd 100644 --- a/src/slskd/Transfers/TransfersDbContext.cs +++ b/src/slskd/Transfers/TransfersDbContext.cs @@ -61,6 +61,16 @@ namespace slskd.Transfers .Entity() .Property(d => d.Direction) .HasConversion(new EnumToStringConverter()); + + modelBuilder + .Entity() + .HasIndex(t => t.Direction) + .HasDatabaseName("IDX_Transfers_Direction"); + + modelBuilder + .Entity() + .HasIndex(t => t.State) + .HasDatabaseName("IDX_Transfers_State"); } } } -- cgit v1.2.3 From a848d8397a1c12e37f59b699f049ce37afcc34a5 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 6 Jul 2025 18:43:48 -0500 Subject: add GetDatabaseIndexes --- src/slskd/Core/Data/SchemaInspector.cs | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/slskd/Core/Data/SchemaInspector.cs b/src/slskd/Core/Data/SchemaInspector.cs index 234b9100..d4fadfba 100644 --- a/src/slskd/Core/Data/SchemaInspector.cs +++ b/src/slskd/Core/Data/SchemaInspector.cs @@ -67,6 +67,8 @@ public static class SchemaInspector dict[table] = columns; } + connection.Close(); + return dict; } catch (Exception ex) @@ -75,8 +77,63 @@ public static class SchemaInspector } } + /// + /// Retrieves the index information for the specified SQLite database. + /// + /// The connection string for the database. + /// The index information. + /// Thrown if the database can't be accessed, or something else goes wrong. + public static Dictionary> GetDatabaseIndexes(string connectionString) + { + try + { + using var connection = new SqliteConnection(connectionString); + connection.Open(); + + var dict = new Dictionary>(); + + using var tableCommand = new SqliteCommand("SELECT name FROM sqlite_master WHERE type='table';", connection); + using var tableReader = tableCommand.ExecuteReader(); + + while (tableReader.Read()) + { + var table = tableReader.GetString(0); + + var indexes = new List(); + + using var command = new SqliteCommand($"PRAGMA index_list({table});", connection); + using var cr = command.ExecuteReader(); + + while (cr.Read()) + { + indexes.Add(new IndexInfo( + Seq: cr.GetInt64(cr.GetOrdinal("seq")), + Name: cr.GetString(cr.GetOrdinal("name")), + Unique: cr.GetInt64(cr.GetOrdinal("unique")) > 0, + Origin: cr.GetString(cr.GetOrdinal("origin")), + Partial: cr.GetInt64(cr.GetOrdinal("partial")) > 0)); + } + + dict[table] = indexes; + } + + connection.Close(); + + return dict; + } + catch (Exception ex) + { + throw new SlskdException($"Failed to retrieve index information for database '{connectionString}'. The database might be corrupt or in use by another application; if the problem persists the backing file may need to be deleted", ex); + } + } + /// /// Represents a SQLite database column. /// public record ColumnInfo(long Cid, string Name, string Type, bool NotNull, object DefaultValue, bool PrimaryKey); + + /// + /// Represents a SQLite database index. + /// + public record IndexInfo(long Seq, string Name, bool Unique, string Origin, bool Partial); } \ No newline at end of file -- cgit v1.2.3 From ab13639cc3ba0b056937fc2ea3502291e26fb791 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 6 Jul 2025 18:47:37 -0500 Subject: add migration to apply indexes to transfers db --- .../Z07062025_TransferIndexesMigration.cs | 89 ++++++++++++++++++++++ src/slskd/Core/Data/Migrator.cs | 1 + 2 files changed, 90 insertions(+) create mode 100644 src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs diff --git a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs new file mode 100644 index 00000000..62ff9e7b --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs @@ -0,0 +1,89 @@ +// +// 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/. +// + +namespace slskd.Migrations; + +using System; +using System.IO; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; + +/// +/// Updates the Transfers table to add indexes on the Direction and State columns. +/// +public class Z07062025_TransferIndexesMigration : IMigration +{ + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string DatabaseName { get; } = "transfers"; + private string ConnectionString => $"Data Source={Path.Combine(Program.DataDirectory, $"{DatabaseName}.db")}"; + + public bool NeedsToBeApplied() + { + // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply + var schema = SchemaInspector.GetDatabaseIndexes(ConnectionString); + var txfers = schema["Transfers"]; + + var directionExists = txfers.Any(c => c.Name == "IDX_Transfers_Direction"); + var stateExists = txfers.Any(c => c.Name == "IDX_Transfers_State"); + + if (directionExists && stateExists) + { + return false; + } + + return true; + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z07062025_TransferIndexesMigration)); + return; + } + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + using var transaction = connection.BeginTransaction(); + + try + { + Log.Information("> Adding missing index(es) on the Transfers table..."); + + var directionCommand = new SqliteCommand(@" + CREATE INDEX IF NOT EXISTS IDX_Transfers_Direction ON Transfers (Direction) + ", connection, transaction); + directionCommand.ExecuteNonQuery(); + + var stateCommand = new SqliteCommand(@" + CREATE INDEX IF NOT EXISTS IDX_Transfers_State ON Transfers (State) + ", connection, transaction); + stateCommand.ExecuteNonQuery(); + + Log.Information("> Index(es) created"); + transaction.Commit(); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } +} diff --git a/src/slskd/Core/Data/Migrator.cs b/src/slskd/Core/Data/Migrator.cs index e359d334..645f4575 100644 --- a/src/slskd/Core/Data/Migrator.cs +++ b/src/slskd/Core/Data/Migrator.cs @@ -48,6 +48,7 @@ public class Migrator private Dictionary Migrations { get; } = new() { { nameof(Z04012025_TransferStateMigration), new Z04012025_TransferStateMigration() }, + { nameof(Z07062025_TransferIndexesMigration), new Z07062025_TransferIndexesMigration() }, }; /// -- cgit v1.2.3 From 652e1b329200f52b4f8b46599d271162d97cdef0 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 11 Jul 2025 13:53:46 -0500 Subject: naming --- src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs index 62ff9e7b..53e6e044 100644 --- a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs @@ -35,8 +35,8 @@ public class Z07062025_TransferIndexesMigration : IMigration public bool NeedsToBeApplied() { // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply - var schema = SchemaInspector.GetDatabaseIndexes(ConnectionString); - var txfers = schema["Transfers"]; + var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); + var txfers = idxes["Transfers"]; var directionExists = txfers.Any(c => c.Name == "IDX_Transfers_Direction"); var stateExists = txfers.Any(c => c.Name == "IDX_Transfers_State"); -- cgit v1.2.3