mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
File Browser
New: File Browser to navigate to folders when choosing paths
This commit is contained in:
parent
a55a77cb5b
commit
85a9b74008
51 changed files with 955 additions and 228 deletions
33
src/NzbDrone.Api/FileSystem/FileSystemModule.cs
Normal file
33
src/NzbDrone.Api/FileSystem/FileSystemModule.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using Nancy;
|
||||
using NzbDrone.Api.Extensions;
|
||||
using NzbDrone.Common.Disk;
|
||||
|
||||
namespace NzbDrone.Api.FileSystem
|
||||
{
|
||||
public class FileSystemModule : NzbDroneApiModule
|
||||
{
|
||||
private readonly IFileSystemLookupService _fileSystemLookupService;
|
||||
|
||||
public FileSystemModule(IFileSystemLookupService fileSystemLookupService)
|
||||
: base("/filesystem")
|
||||
{
|
||||
_fileSystemLookupService = fileSystemLookupService;
|
||||
Get["/"] = x => GetContents();
|
||||
}
|
||||
|
||||
private Response GetContents()
|
||||
{
|
||||
var pathQuery = Request.Query.path;
|
||||
var includeFilesQuery = Request.Query.includeFiles;
|
||||
bool includeFiles = false;
|
||||
|
||||
if (includeFilesQuery.HasValue)
|
||||
{
|
||||
includeFiles = Convert.ToBoolean(includeFilesQuery.Value);
|
||||
}
|
||||
|
||||
return _fileSystemLookupService.LookupContents((string)pathQuery.Value, includeFiles).AsResponse();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue