From 9a0e23a93faaa21ba2cc264b30603aff4d10216e Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 21 Mar 2026 12:33:27 +0200 Subject: [PATCH] Load initial paths for file browser --- .../src/Components/FileBrowser/FileBrowserModalContent.tsx | 6 +++++- frontend/src/Path/usePaths.ts | 1 - src/Sonarr.Api.V5/FileSystem/FileSystemController.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/Components/FileBrowser/FileBrowserModalContent.tsx b/frontend/src/Components/FileBrowser/FileBrowserModalContent.tsx index aaaf9b4e0..1f02f0145 100644 --- a/frontend/src/Components/FileBrowser/FileBrowserModalContent.tsx +++ b/frontend/src/Components/FileBrowser/FileBrowserModalContent.tsx @@ -133,7 +133,11 @@ function FileBrowserModalContent({ className={styles.scroller} scrollDirection="both" > - {error ?
{translate('ErrorLoadingContents')}
: null} + {error ? ( + + {translate('ErrorLoadingContents')} + + ) : null} {isFetched && !error ? ( diff --git a/frontend/src/Path/usePaths.ts b/frontend/src/Path/usePaths.ts index 72bef1cb6..b7a76b486 100644 --- a/frontend/src/Path/usePaths.ts +++ b/frontend/src/Path/usePaths.ts @@ -47,7 +47,6 @@ const usePaths = ({ path: '/filesystem', queryParams: { path, allowFoldersWithoutTrailingSlashes, includeFiles }, queryOptions: { - enabled: path.trim().length > 0, placeholderData: keepPreviousData, }, }); diff --git a/src/Sonarr.Api.V5/FileSystem/FileSystemController.cs b/src/Sonarr.Api.V5/FileSystem/FileSystemController.cs index 2c52ca800..ad54be2f7 100644 --- a/src/Sonarr.Api.V5/FileSystem/FileSystemController.cs +++ b/src/Sonarr.Api.V5/FileSystem/FileSystemController.cs @@ -24,7 +24,7 @@ public FileSystemController(IFileSystemLookupService fileSystemLookupService, [HttpGet] [Produces("application/json")] - public IActionResult GetContents(string path, bool includeFiles = false, bool allowFoldersWithoutTrailingSlashes = false) + public IActionResult GetContents(string? path, bool includeFiles = false, bool allowFoldersWithoutTrailingSlashes = false) { return Ok(_fileSystemLookupService.LookupContents(path, includeFiles, allowFoldersWithoutTrailingSlashes)); }