fix(ui): move Qobuz downloads toggle to general Settings

Move download visibility toggle from LocalLibrary settings to general Settings view:
- Add showQobuzDownloadsInLibrary state in SettingsView
- Add loadDownloadSettings() function
- Add handleShowDownloadsChange() function
- Add toggle in Library section of Settings
- Remove toggle from LocalLibrary settings panel
- Remove toggleShowQobuzDownloads function from LocalLibrary
- Remove showQobuzDownloads state from LocalLibrary
- Restore settings-actions original flex layout

Qobuz downloads are now controlled from Settings > Library section,
not from LocalLibrary settings. LocalLibrary only handles hide/show
of individual albums.

cp
This commit is contained in:
vicrodh committed 2026-01-14 20:59:00 -06:00
1 parent 96a3c56388
commit 5952da661b
2 files changed
+31 -50

No files matched your search

+30 -1
View File
@@ -168,6 +168,7 @@
// Library settings
let fetchQobuzArtistImages = $state(true);
let showQobuzDownloadsInLibrary = $state(false);
// Last.fm integration state
let lastfmConnected = $state(false);
@@ -232,6 +233,9 @@
fetchQobuzArtistImages = savedFetchArtistImages === 'true';
}
// Load download settings
loadDownloadSettings();
// Load cache stats
loadCacheStats();
@@ -450,6 +454,15 @@
}
}
async function handleShowDownloadsChange(enabled: boolean) {
try {
await invoke('set_show_downloads_in_library', { show: enabled });
showQobuzDownloadsInLibrary = enabled;
} catch (e) {
console.error('Failed to update show downloads setting:', e);
}
}
async function handleSaveTidalCredentials() {
if (!tidalClientId || !tidalClientSecret) return;
apiKeysSaving = true;
@@ -656,6 +669,15 @@
}
}
async function loadDownloadSettings() {
try {
const settings = await invoke<{download_root: string, show_in_library: boolean}>('get_download_settings');
showQobuzDownloadsInLibrary = settings.show_in_library;
} catch (err) {
console.error('Failed to load download settings:', err);
}
}
async function handleClearDownloads() {
if (isClearingDownloads) return;
isClearingDownloads = true;
@@ -874,7 +896,7 @@
<!-- Library Section -->
<section class="section">
<h3 class="section-title">{$t('settings.library.title')}</h3>
<div class="setting-row last">
<div class="setting-row">
<div class="setting-with-description">
<span class="setting-label">{$t('settings.library.fetchArtistImages')}</span>
<span class="setting-description">{$t('settings.library.fetchArtistImagesDesc')}</span>
@@ -884,6 +906,13 @@
localStorage.setItem('qbz-fetch-artist-images', String(v));
}} />
</div>
<div class="setting-row last">
<div class="setting-with-description">
<span class="setting-label">Show Qobuz Downloads in Local Library</span>
<span class="setting-description">Display downloaded Qobuz tracks in your Local Library</span>
</div>
<Toggle enabled={showQobuzDownloadsInLibrary} onchange={handleShowDownloadsChange} />
</div>
</section>
<!-- Integrations Section -->