From d8ef747b8bd00b5398d5d9382ec21cdce8a2a3ed Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 4 Aug 2025 08:27:02 -0700 Subject: [PATCH] don't use audio cache to pre-download files if not using waveform seekbar --- backend/app.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/app.go b/backend/app.go index e8143ab..5e5dc1e 100644 --- a/backend/app.go +++ b/backend/app.go @@ -144,11 +144,13 @@ func StartupApp(appName, displayAppName, appVersion, appVersionTag, latestReleas a.ServerManager = NewServerManager(appName, appVersion, a.Config, !portableMode && a.Config.Application.EnablePasswordStorage) a.ImageManager = NewImageManager(a.bgrndCtx, a.ServerManager, cacheDir) - ac, err := NewAudioCache(a.bgrndCtx, a.ServerManager, filepath.Join(cacheDir, "audio")) - if err != nil { - log.Printf("failed to create audio cache: %s", err.Error()) + if a.Config.Playback.UseWaveformSeekbar { + ac, err := NewAudioCache(a.bgrndCtx, a.ServerManager, filepath.Join(cacheDir, "audio")) + if err != nil { + log.Printf("failed to create audio cache: %s", err.Error()) + } + a.AudioCache = ac } - a.AudioCache = ac a.PlaybackManager = NewPlaybackManager(a.bgrndCtx, a.ServerManager, a.AudioCache, a.LocalPlayer, &a.Config.Playback, &a.Config.Scrobbling, &a.Config.Transcoding, &a.Config.Application) a.Config.Application.MaxImageCacheSizeMB = clamp(a.Config.Application.MaxImageCacheSizeMB, 1, 500) a.ImageManager.SetMaxOnDiskCacheSizeBytes(int64(a.Config.Application.MaxImageCacheSizeMB) * 1_048_576)