Files
qbz/src-tauri
vicrodh 4c606e029e feat(favorites): implement local SQLite persistence for favorites
This ensures favorites sync properly across all views (album detail,
continue listening, etc.) by using local persistence as the source
of truth for UI, with API calls for actual operations.

Backend (Rust):
- Add favorites_cache.rs module with SQLite tables:
  - favorite_tracks (track_id INTEGER PRIMARY KEY)
  - favorite_albums (album_id TEXT PRIMARY KEY)
  - favorite_artists (artist_id INTEGER PRIMARY KEY)
- Add Tauri commands for cache operations:
  - get_cached_favorite_* - read from local cache
  - cache_favorite_* / uncache_favorite_* - add/remove single items
  - sync_cached_favorite_* - bulk sync from API data
  - clear_favorites_cache - for logout

Frontend:
- Rewrite favoritesStore.ts to use persistence:
  - loadFavorites(): Load from cache first, then sync from API
  - toggleFavorite(): API call first → update cache on success
  - No optimistic updates - UI shows loading state until confirmed
- Rewrite albumFavoritesStore.ts with same pattern
- Create artistFavoritesStore.ts for artist favorites
- Update +page.svelte to load all favorites on login
- Update FavoritesView to sync cache when loading from API

Sync strategy:
- On login: Fetch from Qobuz API → sync to local cache
- On toggle: API call → on success → update local cache → notify UI
- FavoritesView reads from API and syncs local cache
- All other views read from local cache (instant UI)
2026-01-29 19:42:04 -06:00
..
2026-01-29 01:22:05 -06:00
2026-01-08 22:35:34 -06:00
2026-01-08 22:35:34 -06:00
2026-01-27 04:58:28 -06:00