fix: use persistent cache/Music folder instead of /tmp

- Cache mode now uses cache/Music/ (survives restarts, cleaned after 24h)
- Permanent mode uses downloads/ (keeps forever)
- Fixed all three download services: SquidWTF, Deezer, Qobuz
- Files no longer stored in /tmp/allstarr-cache/ which gets wiped on restart
- Both folders are in project root alongside cache/ and downloads/ directories
This commit is contained in:
2026-02-07 12:02:48 -05:00
parent 3937e637c6
commit bb46db43b1
3 changed files with 12 additions and 3 deletions

View File

@@ -111,7 +111,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;
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache ? CachePath : DownloadPath;
// Cache mode uses cache/Music folder (cleaned up after 24h), Permanent mode uses downloads folder
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache
? Path.Combine("cache", "Music")
: "downloads";
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
// Create directories if they don't exist

View File

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

View File

@@ -130,7 +130,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;
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache ? CachePath : DownloadPath;
// Cache mode uses cache/Music folder (cleaned up after 24h), Permanent mode uses downloads folder
var basePath = SubsonicSettings.StorageMode == StorageMode.Cache
? Path.Combine("cache", "Music")
: "downloads";
var outputPath = PathHelper.BuildTrackPath(basePath, artistForPath, song.Album, song.Title, song.Track, extension);
// Create directories if they don't exist