From bb46db43b1eaafe45f47b0c720049b8c893583eb Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Sat, 7 Feb 2026 12:02:48 -0500 Subject: [PATCH] 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 --- allstarr/Services/Deezer/DeezerDownloadService.cs | 5 ++++- allstarr/Services/Qobuz/QobuzDownloadService.cs | 5 ++++- allstarr/Services/SquidWTF/SquidWTFDownloadService.cs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/allstarr/Services/Deezer/DeezerDownloadService.cs b/allstarr/Services/Deezer/DeezerDownloadService.cs index bf0240e..4d21917 100644 --- a/allstarr/Services/Deezer/DeezerDownloadService.cs +++ b/allstarr/Services/Deezer/DeezerDownloadService.cs @@ -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 diff --git a/allstarr/Services/Qobuz/QobuzDownloadService.cs b/allstarr/Services/Qobuz/QobuzDownloadService.cs index 5da212f..866a829 100644 --- a/allstarr/Services/Qobuz/QobuzDownloadService.cs +++ b/allstarr/Services/Qobuz/QobuzDownloadService.cs @@ -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)!; diff --git a/allstarr/Services/SquidWTF/SquidWTFDownloadService.cs b/allstarr/Services/SquidWTF/SquidWTFDownloadService.cs index 19afe11..8184374 100644 --- a/allstarr/Services/SquidWTF/SquidWTFDownloadService.cs +++ b/allstarr/Services/SquidWTF/SquidWTFDownloadService.cs @@ -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