diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Application.cs | 6 | ||||
| -rw-r--r-- | src/slskd/Users/API/Controllers/UsersController.cs | 2 | ||||
| -rw-r--r-- | src/slskd/slskd.csproj | 2 | ||||
| -rw-r--r-- | src/web/src/components/Search/Response.jsx | 8 |
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 |
