mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 15:45:10 -05:00
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:
@@ -1409,8 +1409,8 @@ public class AdminController : ControllerBase
|
||||
library = new
|
||||
{
|
||||
downloadPath = _subsonicSettings.StorageMode == StorageMode.Cache
|
||||
? Path.Combine("cache", "Music")
|
||||
: (_configuration["Library:DownloadPath"] ?? "./downloads"),
|
||||
? Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "cache")
|
||||
: Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "permanent"),
|
||||
keptPath = Path.Combine(_configuration["Library:DownloadPath"] ?? "./downloads", "kept"),
|
||||
storageMode = _subsonicSettings.StorageMode.ToString(),
|
||||
cacheDurationHours = _subsonicSettings.CacheDurationHours,
|
||||
|
||||
@@ -107,10 +107,10 @@ public class DeezerDownloadService : BaseDownloadService
|
||||
|
||||
// Build organized folder structure: Artist/Album/Track using AlbumArtist (fallback to Artist for singles)
|
||||
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
|
||||
? Path.Combine("cache", "Music")
|
||||
: "downloads";
|
||||
? Path.Combine("downloads", "cache")
|
||||
: Path.Combine("downloads", "permanent");
|
||||
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
|
||||
|
||||
// Create directories if they don't exist
|
||||
|
||||
@@ -110,10 +110,10 @@ public class QobuzDownloadService : BaseDownloadService
|
||||
|
||||
// Build organized folder structure using AlbumArtist (fallback to Artist for singles)
|
||||
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
|
||||
? Path.Combine("cache", "Music")
|
||||
: "downloads";
|
||||
? Path.Combine(DownloadPath, "cache")
|
||||
: Path.Combine(DownloadPath, "permanent");
|
||||
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
|
||||
|
||||
var albumFolder = Path.GetDirectoryName(outputPath)!;
|
||||
|
||||
@@ -125,10 +125,10 @@ public class SquidWTFDownloadService : BaseDownloadService
|
||||
|
||||
// Build organized folder structure: Artist/Album/Track using AlbumArtist (fallback to Artist for singles)
|
||||
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
|
||||
? Path.Combine("cache", "Music")
|
||||
: "downloads";
|
||||
? Path.Combine("downloads", "cache")
|
||||
: Path.Combine("downloads", "permanent");
|
||||
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
|
||||
|
||||
// Create directories if they don't exist
|
||||
|
||||
Reference in New Issue
Block a user