Make kept path configurable via web UI

- Added Library:KeptPath to appsettings.json (default: /app/kept)
- Added Library Settings card to web UI with DownloadPath and KeptPath
- Updated GetDownloads and DeleteDownload endpoints to use configured path
- Updated JellyfinController to use configured kept path
- Injected IConfiguration into JellyfinController
- Users can now customize where favorited tracks are stored
This commit is contained in:
2026-02-07 00:35:12 -05:00
parent c9b44dea43
commit 440ef9850f
4 changed files with 35 additions and 6 deletions

View File

@@ -1450,6 +1450,11 @@ public class AdminController : ControllerBase
userId = _jellyfinSettings.UserId ?? "(not set)",
libraryId = _jellyfinSettings.LibraryId
},
library = new
{
downloadPath = _configuration["Library:DownloadPath"] ?? "./downloads",
keptPath = _configuration["Library:KeptPath"] ?? "/app/kept"
},
deezer = new
{
arl = MaskValue(_deezerSettings.Arl, showLast: 8),
@@ -3331,7 +3336,7 @@ public class LinkPlaylistRequest
{
try
{
var keptPath = "/app/kept";
var keptPath = _configuration["Library:KeptPath"] ?? "/app/kept";
_logger.LogInformation("📂 Checking kept folder: {Path}", keptPath);
_logger.LogInformation("📂 Directory exists: {Exists}", Directory.Exists(keptPath));
@@ -3414,7 +3419,7 @@ public class LinkPlaylistRequest
return BadRequest(new { error = "Path is required" });
}
var keptPath = "/app/kept";
var keptPath = _configuration["Library:KeptPath"] ?? "/app/kept";
var fullPath = Path.Combine(keptPath, path);
_logger.LogInformation("🗑️ Delete request for: {Path}", fullPath);