Files
qbz/src/lib/stores/downloadSettingsStore.ts
T
vicrodh 51cfcd1c32 Fix LocalLibrary not respecting 'Show in Local Library' setting
Problem: When user toggled the "Show Qobuz Downloads in Local Library"
setting in Settings, LocalLibraryView didn't refresh, so downloaded
tracks continued to appear even when the setting was disabled.

Root cause: LocalLibraryView only loaded data onMount and had no
mechanism to detect when download settings changed.

Solution:
- Created downloadSettingsStore with version tracking
- SettingsView notifies store when setting changes
- LocalLibraryView subscribes via $effect() and reloads data

Backend was already correctly filtering by the setting - this was
purely a frontend reactivity issue.

Files changed:
- src/lib/stores/downloadSettingsStore.ts (new)
- src/lib/components/views/SettingsView.svelte
- src/lib/components/views/LocalLibraryView.svelte
2026-01-20 00:26:29 -06:00

17 lines
544 B
TypeScript

import { writable } from 'svelte/store';
/**
* Store to track download settings changes
* Increments whenever download settings are updated (download root or show_in_library)
* Components can subscribe to this to refresh when settings change
*/
export const downloadSettingsVersion = writable(0);
/**
* Call this whenever download settings are updated
* This triggers a refresh in components that subscribe to downloadSettingsVersion
*/
export function notifyDownloadSettingsChanged() {
downloadSettingsVersion.update(n => n + 1);
}