aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-04-12 17:16:46 -0500
committerGitHub <noreply@github.com>2025-04-12 17:16:46 -0500
commit0e4e270f480ea667dd8406f33ddc512f737289d8 (patch)
tree4084f3c9e90d4c0ab3b2c917aa9d7e092d021120 /src
parent667991f4c969317fd8a35e9443e1f238e9303632 (diff)
parent66c60cadfa300d88f1b66d9e4d6174803b18c3ef (diff)
downloadslskd-0e4e270f480ea667dd8406f33ddc512f737289d8.tar.gz
Merge pull request #1324 from slskd/directory-bugfix
Fix bug preventing full directory from being fetched while reviewing search results
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs6
-rw-r--r--src/slskd/Users/API/Controllers/UsersController.cs2
-rw-r--r--src/slskd/slskd.csproj2
-rw-r--r--src/web/src/components/Search/Response.jsx8
4 files changed, 15 insertions, 3 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 9179987e..2449e8e0 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -830,6 +830,12 @@ namespace slskd
var logger = Loggers.GetOrAdd(source, Log.ForContext("Context", "Soulseek").ForContext("SubContext", source));
+ if (args.IncludesException && OptionsAtStartup.Debug)
+ {
+ logger.Write(TranslateLogLevel(args.Level), exception: args.Exception, "{@Message}", args.Message);
+ return;
+ }
+
logger.Write(TranslateLogLevel(args.Level), "{@Message}", args.Message);
}
diff --git a/src/slskd/Users/API/Controllers/UsersController.cs b/src/slskd/Users/API/Controllers/UsersController.cs
index 01df31d1..da581ab8 100644
--- a/src/slskd/Users/API/Controllers/UsersController.cs
+++ b/src/slskd/Users/API/Controllers/UsersController.cs
@@ -152,7 +152,7 @@ namespace slskd.Users.API
/// <returns></returns>
[HttpPost("{username}/directory")]
[Authorize(Policy = AuthPolicy.Any)]
- [ProducesResponseType(typeof(Directory), 200)]
+ [ProducesResponseType(typeof(IEnumerable<Directory>), 200)]
[ProducesResponseType(404)]
public async Task<IActionResult> Directory([FromRoute, Required] string username, [FromBody, Required] DirectoryContentsRequest request)
{
diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj
index 0a5d0683..39248289 100644
--- a/src/slskd/slskd.csproj
+++ b/src/slskd/slskd.csproj
@@ -67,7 +67,7 @@
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Grafana.Loki" Version="7.1.1" />
<PackageReference Include="Serilog.Sinks.Http" Version="8.0.0" />
- <PackageReference Include="Soulseek" Version="7.0.1" />
+ <PackageReference Include="Soulseek" Version="7.0.3" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
diff --git a/src/web/src/components/Search/Response.jsx b/src/web/src/components/Search/Response.jsx
index 40029b0c..f665c816 100644
--- a/src/web/src/components/Search/Response.jsx
+++ b/src/web/src/components/Search/Response.jsx
@@ -83,11 +83,17 @@ class Response extends Component {
const oldTree = { ...this.state.tree };
const oldFiles = oldTree[directory];
- const { files, name } = await getDirectoryContents({
+ // some clients might send more than one directory in the response,
+ // if the requested directory contains subdirectories. the root directory
+ // is always first, and for now we'll only display the contents of that.
+ const allDirectories = await getDirectoryContents({
directory,
username,
});
+ const theRootDirectory = allDirectories?.[0];
+ const { files, name } = theRootDirectory;
+
// the api returns file names only, so we need to prepend the directory
// to make it look like a search result. we also need to preserve
// any file selections, so check the old files and assign accordingly