Commit Graph
180 Commits
Author SHA1 Message Date
vicrodh 6cea4149c0 Migrate all queue operations to V2 commands
- Add V2 queue commands: v2_set_shuffle, v2_move_queue_track,
  v2_add_tracks_to_queue, v2_add_tracks_to_queue_next,
  v2_remove_upcoming_track
- Migrate queueStore.ts to use all V2 queue commands
- Update all view components to use V2 queue commands:
  - HomeView, SearchView, ArtistDetailView, FavoritesView
  - LocalLibraryView, PlaylistDetailView
- Update +page.svelte to use V2 shuffle, repeat, and remove commands

No legacy queue commands are called from frontend anymore.
2026-02-14 23:21:19 -06:00
vicrodh 82a81e1ded feat(v2): add MPRIS, gapless, and prefetch V2 commands
V2 Playback Features:
- v2_set_media_metadata: Update MPRIS metadata
- v2_play_next_gapless: Queue next track for gapless playback
- v2_prefetch_track: Pre-download track into memory cache

V2 Command Updates:
- v2_pause/resume/stop: Now update MPRIS state
- v2_seek: Updates MPRIS progress
- v2_get_playback_state: Updates MPRIS progress on poll

Frontend Migration:
- playbackService: Use v2_set_media_metadata
- playerStore: Use v2_play_next_gapless
2026-02-14 22:42:03 -06:00
vicrodh 6b432586a7 feat(frontend): migrate playback commands to V2
Migrate all frontend playback invocations to V2 commands:
- play_track -> v2_play_track
- pause_playback -> v2_pause_playback
- resume_playback -> v2_resume_playback
- stop_playback -> v2_stop_playback
- seek -> v2_seek
- set_volume -> v2_set_volume

Updated files:
- playbackService.ts
- playerStore.ts
- playerStore.test.ts
- castStore.ts
- SettingsView.svelte

Frontend now uses V2 architecture for all Qobuz playback operations.
2026-02-14 22:17:36 -06:00
vicrodh 901b0edab8 Fix system title bar sync only propagating true values
The localStorage->backend sync only ran when useSystemTitleBar was true,
so toggling it OFF never persisted to the database. On restart, the
backend read the old 'true' value and created the window with system
decorations, while the UI showed 'false' from localStorage.

Now syncs the value unconditionally on init.
2026-02-12 13:56:33 -06:00
vicrodh 14e657e8af Optimize console log capture in production
Only capture log/info levels in dev builds or when verbose mode is
explicitly enabled in Developer Mode. Always capture error/warn for
bug tracking. Reduces GC/CPU overhead in production builds.

Adds toggle in Settings > Developer Mode to enable verbose capture
when debugging production issues.
2026-02-12 13:34:02 -06:00
vicrodh 51a24de9cb Fix async listener leak on fast unmount/HMR
Apply disposed flag pattern to prevent listener leaks when component
unmounts before async listen() calls complete.

+page.svelte:
- Add disposed flag for tray/media control listeners
- Check disposed after each await listen(), cleanup immediately if true
- Set disposed=true at start of cleanup function

offlineCacheState.ts:
- Add listenersDisposed flag
- Check flag after each listener registration
- Cleanup any registered listeners if disposed during async sequence
- Set flag in stopOfflineCacheEventListeners()

This prevents memory leaks during HMR and fast navigation.
2026-02-12 13:27:00 -06:00
vicrodh 36632548fe Add idempotency guard to offline cache listeners
Prevents duplicate event listeners if startOfflineCacheEventListeners
is called multiple times (e.g., during HMR or accidental remount).
2026-02-12 13:02:41 -06:00
vicrodh 07f9f64a08 fix: persist volume and tray settings across restarts
Volume was saved to per-user localStorage but loaded from unscoped key
before login set the userId. Added resyncPersistedVolume() called after
login to re-read from the correct scoped key.

Close/minimize to tray read settings once at startup from the flat-path
DB, but user changes were saved to per-user DB after login. Changed
close-to-tray to read dynamically from state, and minimize-to-tray to
re-fetch before each action.
2026-02-10 06:23:05 -06:00
vicrodh b76b369d9b feat: wire up discover playlists browse page with navigation and i18n 2026-02-10 01:51:31 -06:00
vicrodh 0f8bba5f89 feat: add playlist tags endpoint and DiscoverPlaylistsBrowseView component 2026-02-10 01:48:37 -06:00
vicrodh ba62057545 feat: add Qobuzissimes, Albums of the Week, Press Accolades browse pages
- Add 3 new Rust endpoint constants and command mappings for
  /discover/qobuzissims, /discover/albumOfTheWeek, /discover/pressAward
- Add 3 new navigation ViewType values and genre filter contexts
- Extend DiscoverBrowseView to handle the 3 new endpoint types
- Add See All links with chevron caret and pipe separator to all 6
  discover sections in HomeView (newReleases, mostStreamed,
  essentialDiscography, qobuzissimes, editorPicks, pressAwards)
- Wire up 3 new views in +page.svelte with full album action callbacks
- Rename Editor's Picks to Albums of the Week, Press Awards to Press
  Accolades across all 4 locale files (en, es, de, fr)
- Fix rank badge: top-right position, Impact font, 35px size
- See All styling: inline-flex with ChevronRight icon, pipe divider,
  15px gap before nav buttons, #666666 color matching nav buttons
2026-02-10 01:10:28 -06:00
vicrodh a575c0c805 fix: use existing genre filter, fix ranking display and See All positioning
- Replace custom genre <select> with GenreFilterButton component, each
  discover page gets independent persistence via separate contexts
- Rank badge in grid mode: 3x bigger (33px), positioned on right side
  of album card, no # symbol
- See All link: pushed to right edge (margin-left: auto), color matches
  nav buttons (#666666), hover transitions to text-primary
- Add proper page padding to DiscoverBrowseView (18px left, 8px right)
2026-02-10 00:57:57 -06:00
vicrodh c9bdcae855 feat: add discover browse pages for New Releases, Ideal Discography, Top Albums
Add full-page browsing views for the three discover sections that were
previously only shown as limited carousels on the Home page.

Backend: add get_discover_albums Tauri command with endpoints for
newReleases, idealDiscography, and mostStreamed. Uses paginated API
calls with genre_ids filtering.

Frontend: new DiscoverBrowseView component with virtualized grid/list,
genre filter dropdown, client-side search, and infinite scroll.
VirtualizedFavoritesAlbumGrid gains ranking support (showRanking),
infinite scroll (onLoadMore), and loading indicator.

HomeView sections now show "See All" links that navigate to the
dedicated browse pages. i18n keys added to all 4 locales.
2026-02-10 00:46:39 -06:00
vicrodh fcafac095c fix(window): always restart on system titlebar toggle
Runtime decoration toggling doesn't work reliably in either direction
on Linux/Wayland. Always restart the app so the window is recreated
with the correct decoration state.
2026-02-09 14:40:31 -06:00
vicrodh 68b227f46c fix(window): only restart when enabling system titlebar
Disabling system titlebar works at runtime (decorations:true -> false
is fine on Linux/Wayland). Only enabling requires a restart because
the window must be born with decorations:true for WM buttons to work.

When disabling: remove OS decorations via setDecorations(false) and
restore the custom title bar immediately via notifyListeners().
2026-02-09 13:38:12 -06:00
vicrodh c88974c468 feat(window): restart app on system titlebar toggle
Since the window must be created with the correct decoration state
(runtime toggling doesn't work on Linux/Wayland), persist the setting
to the Rust backend and restart the app immediately.

Add restart_app Tauri command using AppHandle::restart(). Update i18n
descriptions to inform the user the app will restart.
2026-02-09 13:36:57 -06:00
vicrodh 50569b61b5 fix(window): sync localStorage value to Rust backend on init
When the frontend initializes and finds useSystemTitleBar=true in
localStorage, sync it to the Rust SQLite store. This handles migration
from the localStorage-only era and ensures the Rust backend has the
correct value for next startup.
2026-02-09 13:25:05 -06:00
vicrodh 32a7f2c807 fix(window): set system decorations before window show
Move decoration setting to Rust side so the WM sees correct state when
the window is first mapped. Window starts hidden (visible: false in
tauri.conf.json), Rust reads the persisted setting from SQLite, applies
decorations, then shows the window.

Frontend now persists the setting via Tauri invoke (in addition to
localStorage) so Rust can read it at startup. Inline script in app.html
prevents flash of custom title bar before Svelte mounts.
2026-02-09 13:18:50 -06:00
vicrodh 7b5bd166d4 feat(settings): add system title bar toggle
Add option to use OS native window decorations instead of the custom
QBZ title bar. Uses Tauri setDecorations() API to toggle at runtime.
Disables "Hide title bar" toggle when system bar is active.
2026-02-09 13:03:56 -06:00
vicrodh ee7ea4f164 feat: SWR cache for Sidebar playlists
Sidebar now uses stale-while-revalidate for playlists, settings,
and local track counts. On mount, cached data is shown immediately
while fresh data loads in the background.

- Create sidebarDataCache.ts with sessionStorage persistence
- Sidebar restores from cache on mount (fresh/stale), loads in background
- Cache cleared only on real playlist changes (create/delete/track changes)
- Sort order, play counts, and UI state do NOT invalidate the cache
- Coordinated loadSidebarData() replaces three independent load calls
2026-02-09 08:33:15 -06:00
vicrodh 4aa32d388b feat: SWR cache for Home with stale-while-revalidate
homeDataCache now has three states:
- fresh (<5 min): use cache, no revalidation
- stale (5-60 min): show cache immediately, revalidate in background
- empty (>60 min / genre mismatch / no data): full skeleton load

Changes:
- Replace isHomeCacheValid() with getHomeCacheStatus() -> fresh/stale/empty
- Add sessionStorage persistence for cross-navigation survival
- Stop destroying cache data on staleness (was nullifying at 5 min)
- HomeView onMount uses three-state logic
- loadHome() accepts showSkeletons option for silent revalidation
- Extract restoreFromCache() helper for DRY cache restoration
2026-02-09 08:29:12 -06:00
vicrodh fb3204f2e4 merge(pre-release): sync latest integration branch into plex feature
cx
2026-02-09 02:25:37 -06:00
vicrodh 228563454b feat(plex): checkpoint plex lan integration and quality sync
cx
2026-02-09 01:28:11 -06:00
vicrodh 363495cb15 Add Developer Mode section to Settings; fix Factory Reset always visible bug
Developer Mode: collapsible section (hidden from jump-nav) with Force DMA-BUF
toggle and View Logs button. LogsModal shows Terminal/Console tabs with
0x0.st upload. Console capture wraps console.log/warn/error/info.

Bugfix: Factory Reset row was outside {#if !storageCollapsed}, making it
always visible even when Storage section was collapsed.
2026-02-08 15:01:09 -06:00
vicrodh f3be2b737f feat(ui): wire artist click through all views using AlbumCard
Pass artistId and onArtistClick to AlbumCard in HomeView, SearchView,
FavoritesView, LabelView, and AlbumDetailView. Add artistId to
AlbumCardData interface. Add onArtistClick prop to LabelView and wire
it from +page.svelte.
2026-02-08 13:10:02 -06:00
vicrodh be80ce1470 feat(nav): add back button to FavoritesView and scroll position memory
FavoritesView now has a conditional back button (shown when onBack
prop is provided). Added scroll position save/restore infrastructure
to navigationStore (saveScrollPosition/getSavedScrollPosition keyed
by ViewType). FavoritesView saves scroll position on scroll and
restores it when returning to the view.
2026-02-08 12:09:56 -06:00
vicrodh a21f7c7a93 feat(audio): implement gapless playback for cached tracks
Backend: Add PlayNext command to audio thread that appends decoded
sources to the existing Rodio Sink for seamless transitions. The audio
thread detects when ~5s remain and signals gapless_ready via SharedState.
Position-based transition detection updates track metadata when the
queued source begins playing.

Frontend: playerStore detects gapless_ready flag, invokes
play_next_gapless (cache-only lookup), and handles transitions by
advancing the queue without stop/play cycle. playbackService gains
gaplessTransition option to skip stop_playback when backend already
transitioned.

Gapless is only eligible when: same sample rate/channels, cached data,
Rodio backend (not ALSA Direct), not streaming, not a user skip.
Falls back to normal stop-play flow when ineligible.
2026-02-08 09:05:39 -06:00
vicrodh 00d0ce7835 feat(ui): add normalization toggle to player bar
Adds 3-state normalization icon between fullscreen and volume controls.
Uses mask-image SVGs for theme-compatible coloring. Reduces song card
min-width by 72px to accommodate the new control.
2026-02-07 22:55:18 -06:00
vicrodh 3990d7bdcf fix(updates): gate launch modals on session readiness
decideLaunchModals() was racing activate_user_session() because
setLoggedIn() triggers the $effect before the backend store opens.
Preferences defaulted to showWhatsNewOnLaunch=true, ignoring the
user's saved setting.

Add sessionReady flag set after activate_user_session completes.
The $effect now waits for session + home view before running.
Also reset all update state on logout for clean re-login cycle.

cc
2026-02-07 12:48:34 -06:00
vicrodh 28742fa19e fix(updates): ensure preferences are loaded from backend after login
initUpdatesStore() set its initialized flag before the async preference
fetch completed. If get_update_preferences failed (backend store not
yet ready), preferences stayed at defaults (both true) and were never
re-fetched. This caused:
- "Show What's New" toggle appearing enabled despite being disabled
- "Check for updates on launch" toggle not persisting
- Changelog modal reappearing on every restart

Changes:
- Split initialized flag into versionLoaded/prefsLoaded so preference
  loading retries until the backend store is ready
- Call refreshUpdatePreferences() in decideLaunchModals() to always
  get fresh data before making modal decisions
- Call refreshUpdatePreferences() in handleLoginSuccess() after
  session activation so SettingsView reflects saved values

cc
2026-02-07 11:58:32 -06:00
vicrodh 1666672f0c fix: version unavailable in changelog button
initUpdatesStore used Promise.all for get_current_version and
get_update_preferences. Since preferences need the SQLite store
(only available after login), the failure killed both promises,
leaving currentVersion as empty string.

Split into independent calls so the version (a compile-time constant
that never needs a session) is always available regardless of
preference store state.
2026-02-07 03:33:52 -06:00
vicrodh 29eb8b0d96 cleanup: remove DEBUG-43 console logging
Remove all [DEBUG-43] console.warn/error entries added during blank
album investigation. Keep essential error logging without the prefix.
2026-02-07 02:53:38 -06:00
vicrodh 08dc86b987 add homeDataCache store for instant Home navigation
Module-level in-memory cache that stores all 11 Home sections'
resolved data with TTL (5 min) and genre filter snapshot validation.
Follows the same pattern as searchState.ts.
2026-02-06 21:20:06 -06:00
vicrodh 71bbc42bcf fix: validate genre filter to prevent empty home sections
Add validateAndCleanStoredGenreIds() to detect and remove stale genre IDs
from localStorage that do not exist in the loaded genre list. This prevents
the Qobuz API from returning empty results when localStorage contains
outdated genre IDs from previous sessions.

The validation runs after loading genres from both cache and API paths.
2026-02-06 03:14:05 -06:00
vicrodh 9503ad9d49 defer per-user store init to post-login, reduce pre-login console noise
Moved initOfflineCacheStates, initPlaybackPreferences, initBlacklistStore
from onMount (before login) to handleLoginSuccess (after session active).
Downgraded pre-login "No active session" errors to debug level for
qobuzLegalStore, TitleBar tray settings, and offlineStore.
2026-02-05 23:53:28 -06:00
vicrodh c237ccee50 replace localStorage with per-user scoped storage in stores and views
Swap localStorage.getItem/setItem/removeItem for getUserItem/setUserItem/
removeUserItem from userStorage.ts across all stores, services, and view
components that use qbz- prefixed keys.

Global keys (theme, zoom-level, locale) remain as direct localStorage
since they're read before login during bootstrap.
2026-02-05 23:30:45 -06:00
vicrodh 8b3047b8fc add frontend per-user session lifecycle
- userStorage.ts: per-user localStorage scoping utility with migration
- authStore: add userId to UserInfo interface
- LoginView: extract user_id from login/auto_login responses
- +page.svelte: call activate_user_session after login,
  deactivate_user_session before logout, set up per-user localStorage
2026-02-05 23:22:43 -06:00
vicrodh a70a33577c fix(player): resume playback from queue after stop (#46)
When user presses STOP then PLAY, playback now resumes the current
queue track instead of doing nothing. Added onResumeFromStop callback
in playerStore that queries the backend queue state and re-plays the
current track. The audio cache ensures instant playback within the
same session.
2026-02-05 11:11:48 -06:00
vicrodh af0e235bb2 fix(immersive): close lyrics sidebar when entering immersive (#47)
Lyrics sidebar was staying open behind the immersive player, causing
duplicate CPU usage for synced lyrics rendering. Now hideLyricsSidebar
is called alongside closeAllMenus when opening fullscreen or focus mode.
2026-02-05 08:37:52 -06:00
vicrodh 2f5f5ff8a6 fix(volume): restore pre-mute volume on unmute (#48)
Mute now saves the current volume before setting to 0, and unmute
restores it. Pre-mute volume persists in localStorage across sessions.
Centralized toggleMute in playerStore so all UI components (NowPlayingBar,
immersive VolumeSlider) behave consistently. Also moved session volume
persistence into setVolume to avoid duplication.
2026-02-05 08:36:56 -06:00
vicrodh 348d57e84f fix(immersive): close popups and raise z-index on open (#47)
Dropdowns and popups with z-index 10000 were appearing over the
immersive player (z-index 100). Raise immersive to 10001 and call
closeAll() on the floating menu store when entering immersive mode.
2026-02-05 08:34:13 -06:00
vicrodh 0877213625 feat: add warning toast type
The 'warning' type was being used but not defined in ToastType.

cc
2026-02-04 14:20:07 -06:00
vicrodh deaffa183d feat(home): add Qobuz discover playlists section with tag filter
- Add backend endpoint for /discover/playlists API
- Add PlaylistTagFilter dropdown component for filtering by genre
- Add QobuzPlaylistCard with CSS blur background effect (color-thief style)
- Add HorizontalScrollRow header snippet for custom headers with scroll controls
- Add session cache store for caching API responses
- Add i18n keys for playlist filter and discover section

cc
2026-02-03 21:37:26 -06:00
vicrodh 477258d94a feat(remote): sync shuffle/repeat between desktop and PWA
- Add shuffle/repeat fields to PlaybackEvent struct
- Emit queue:state event when shuffle/repeat changes via API
- Add queue event listener in desktop frontend
- Include shuffle/repeat in WebSocket broadcasts
- PWA updates shuffle/repeat from WebSocket messages

This enables bidirectional sync: changes from PWA update desktop UI,
and changes from desktop update PWA via WebSocket.
2026-02-03 09:22:55 -06:00
vicrodh 6b85086b0a fix(player): sync volume from backend playback events
Update the local volume state when receiving playback events from the
backend. This ensures the volume slider reflects changes made via
remote control or other external sources.
2026-02-03 09:14:52 -06:00
vicrodh 21054b9f22 fix(player): update player state immediately on external track change
Call notifyListeners() right after setting currentTrack when track
changes from remote control. Also update isPlaying and currentTime
from the event to ensure player UI reflects correct state.

Added debug logging for queue track mismatches.
2026-02-03 08:39:09 -06:00
vicrodh d1347bc425 fix(player): sync queue when track changes from remote control
When a track change is detected from an external source (e.g., PWA
remote control), also sync the full queue state. This fixes the issue
where desktop UI showed empty queue after PWA started playback.
2026-02-03 08:28:39 -06:00
vicrodh 53b9031c36 fix(player): sync track changes from remote control
When tracks are changed externally (via PWA remote control), the desktop
player now detects the track_id mismatch and fetches the new track info
from the backend queue. This fixes bidirectional sync where skipping
tracks on the PWA wasn't reflected in the QBZ desktop UI.
2026-02-03 05:16:17 -06:00
vicrodh 6104bbf09d feat: add Ctrl+F keybinding for search focus
- Add 'nav.search' action with Ctrl+F default shortcut
- Add focusSearch() export to Sidebar that clears and focuses search
- Add translations for en/es (Search / Buscar)
- Register action handler in +page.svelte
2026-02-02 23:47:41 -06:00
vicrodh 6db319b67a fix(keybindings): use regular variables instead of runes at module level
$state and $derived at module level cause "Cannot access uninitialized
variable" error during SSR. Changed to lazy initialization with getter
functions.
2026-02-02 23:14:46 -06:00