fix: use unified download structure for cache and permanent files

- Cache mode now uses downloads/cache/ instead of cache/Music/
- Permanent mode now uses downloads/permanent/ instead of downloads/
- Kept files already use downloads/kept/
- All download paths now unified under downloads/ base directory
This commit is contained in:
2026-02-08 01:38:14 -05:00
parent b0e07404c9
commit aa9f0d0345
4 changed files with 11 additions and 11 deletions

View File

@@ -1409,8 +1409,8 @@ public class AdminController : ControllerBase
library = new library = new
{ {
downloadPath = _subsonicSettings.StorageMode == StorageMode.Cache downloadPath = _subsonicSettings.StorageMode == StorageMode.Cache
? Path.Combine("cache", "Music") ? Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "cache")
: (_configuration["Library:DownloadPath"] ?? "./downloads"), : Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "permanent"),
keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"), keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"),
storageMode = _subsonicSettings.StorageMode.ToString(), storageMode = _subsonicSettings.StorageMode.ToString(),
cacheDurationHours = _subsonicSettings.CacheDurationHours, cacheDurationHours = _subsonicSettings.CacheDurationHours,

View File

@@ -107,10 +107,10 @@ public class DeezerDownloadService : BaseDownloadService
// Build organized folder structure: Artist/Album/Track using AlbumArtist (fallback to Artist for singles) // Build organized folder structure: Artist/Album/Track using AlbumArtist (fallback to Artist for singles)
var artistForPath = song.AlbumArtist ?? song.Artist; var artistForPath = song.AlbumArtist ?? song.Artist;
// Cache mode uses cache/Music folder (cleaned up after 24h), Permanent mode uses downloads folder // Cache mode uses downloads/cache/ folder, Permanent mode uses downloads/permanent/
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache var basePath = SubsonicSettings.StorageMode == StorageMode.Cache
? Path.Combine("cache", "Music") ? Path.Combine("downloads", "cache")
: "downloads"; : Path.Combine("downloads", "permanent");
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension); var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
// Create directories if they don't exist // Create directories if they don't exist

View File

@@ -110,10 +110,10 @@ public class QobuzDownloadService : BaseDownloadService
// Build organized folder structure using AlbumArtist (fallback to Artist for singles) // Build organized folder structure using AlbumArtist (fallback to Artist for singles)
var artistForPath = song.AlbumArtist ?? song.Artist; var artistForPath = song.AlbumArtist ?? song.Artist;
// Cache mode uses cache/Music folder (cleaned up after 24h), Permanent mode uses downloads folder // Cache mode uses downloads/cache/ folder, Permanent mode uses downloads/permanent/
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache var basePath = SubsonicSettings.StorageMode == StorageMode.Cache
? Path.Combine("cache", "Music") ? Path.Combine(DownloadPath, "cache")
: "downloads"; : Path.Combine(DownloadPath, "permanent");
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension); var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
var albumFolder = Path.GetDirectoryName(outputPath)!; var albumFolder = Path.GetDirectoryName(outputPath)!;

View File

@@ -125,10 +125,10 @@ public class SquidWTFDownloadService : BaseDownloadService
// Build organized folder structure: Artist/Album/Track using AlbumArtist (fallback to Artist for singles) // Build organized folder structure: Artist/Album/Track using AlbumArtist (fallback to Artist for singles)
var artistForPath = song.AlbumArtist ?? song.Artist; var artistForPath = song.AlbumArtist ?? song.Artist;
// Cache mode uses cache/Music folder (cleaned up after 24h), Permanent mode uses downloads folder // Cache mode uses downloads/cache/ folder, Permanent mode uses downloads/permanent/
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache var basePath = SubsonicSettings.StorageMode == StorageMode.Cache
? Path.Combine("cache", "Music") ? Path.Combine("downloads", "cache")
: "downloads"; : Path.Combine("downloads", "permanent");
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension); var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
// Create directories if they don't exist // Create directories if they don't exist