From b0e07404c90effe397f70a662e041249be7cfe64 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Sun, 8 Feb 2026 01:25:24 -0500 Subject: [PATCH] refactor: unified download folder structure - Changed from separate paths to unified structure under downloads/ - Structure: downloads/{permanent,cache,kept}/ - Removed Library:KeptPath config, now uses downloads/kept/ - Updated AdminController and JellyfinController to use new paths - Web UI will now correctly show kept tracks in Active Playlists tab - Matches user's actual folder structure on server --- allstarr/Controllers/AdminController.cs | 8 ++++---- allstarr/Controllers/JellyfinController.cs | 4 ++-- allstarr/appsettings.json | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/allstarr/Controllers/AdminController.cs b/allstarr/Controllers/AdminController.cs index e1d7b1c..3fb01f9 100644 --- a/allstarr/Controllers/AdminController.cs +++ b/allstarr/Controllers/AdminController.cs @@ -1411,7 +1411,7 @@ public class AdminController : ControllerBase downloadPath = _subsonicSettings.StorageMode == StorageMode.Cache ? Path.Combine("cache", "Music") : (_configuration["Library:DownloadPath"] ?? "./downloads"), - keptPath = _configuration["Library:KeptPath"] ?? "/app/kept", + keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"), storageMode = _subsonicSettings.StorageMode.ToString(), cacheDurationHours = _subsonicSettings.CacheDurationHours, downloadMode = _subsonicSettings.DownloadMode.ToString() @@ -3306,7 +3306,7 @@ public class LinkPlaylistRequest { try { - var keptPath = _configuration["Library:KeptPath"] ?? "/app/kept"; + var keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"); _logger.LogInformation("📂 Checking kept folder: {Path}", keptPath); _logger.LogInformation("📂 Directory exists: {Exists}", Directory.Exists(keptPath)); @@ -3389,7 +3389,7 @@ public class LinkPlaylistRequest return BadRequest(new { error = "Path is required" }); } - var keptPath = _configuration["Library:KeptPath"] ?? "/app/kept"; + var keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"); var fullPath = Path.Combine(keptPath, path); _logger.LogInformation("🗑️ Delete request for: {Path}", fullPath); @@ -3453,7 +3453,7 @@ public class LinkPlaylistRequest return BadRequest(new { error = "Path is required" }); } - var keptPath = _configuration["Library:KeptPath"] ?? "/app/kept"; + var keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"); var fullPath = Path.Combine(keptPath, path); // Security: Ensure the path is within the kept directory diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index 209bdfe..309200f 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -3916,7 +3916,7 @@ public class JellyfinController : ControllerBase } // Build kept folder path: Artist/Album/ - var keptBasePath = _configuration["Library:KeptPath"] ?? "/app/kept"; + var keptBasePath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"); var keptArtistPath = Path.Combine(keptBasePath, PathHelper.SanitizeFileName(song.Artist)); var keptAlbumPath = Path.Combine(keptArtistPath, PathHelper.SanitizeFileName(song.Album)); @@ -4212,7 +4212,7 @@ public class JellyfinController : ControllerBase var song = await _metadataService.GetSongAsync(provider!, externalId!); if (song == null) return; - var keptBasePath = _configuration["Library:KeptPath"] ?? "/app/kept"; + var keptBasePath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"); var keptArtistPath = Path.Combine(keptBasePath, PathHelper.SanitizeFileName(song.Artist)); var keptAlbumPath = Path.Combine(keptArtistPath, PathHelper.SanitizeFileName(song.Album)); diff --git a/allstarr/appsettings.json b/allstarr/appsettings.json index 771d34a..f5e6fa6 100644 --- a/allstarr/appsettings.json +++ b/allstarr/appsettings.json @@ -32,8 +32,7 @@ "EnableExternalPlaylists": true }, "Library": { - "DownloadPath": "./downloads", - "KeptPath": "/app/kept" + "DownloadPath": "./downloads" }, "Qobuz": { "UserAuthToken": "your-qobuz-token",