- Added onTrackOpenFolder and onTrackReDownload to Props interface
- Pass download props to menuActions in TrackRow
- Only show Download options for Qobuz tracks (not local tracks)
- Wire up handlers in main app component
- Completes Download menu implementation across all views
- Added onDownload, isTrackDownloaded, onOpenFolder, onReDownload to TrackMenuActions interface
- Pass download props from menuActions to TrackMenu in TrackRow
- Removed debug logging
- Fixes Download menu missing in HomeView, AlbumDetailView, and FavoritesView
- Moved {@const isTrackDownloaded} to be direct child of {#each} loops
- Removed invalid placement inside <div> elements
- Fixed both track list instances (all results and dedicated tracks tab)
- Added handleTrackOpenFolder, handleTrackReDownload, and checkTrackDownloaded handlers
- Imported openTrackFolder from downloadState.ts
- Connected all handlers to HomeView, AlbumDetailView, SearchView, and FavoritesView
- Download submenu now fully functional across all Qobuz track views
- Created open_track_folder Rust command to open folder containing downloaded track
- Added frontend wrappers: openTrackFolder and reDownloadTrack in downloadState.ts
- Updated all Qobuz views to support Download submenu:
- HomeView: Added track download props and handlers
- AlbumDetailView: Added onTrackOpenFolder and onTrackReDownload
- SearchView: Added track download actions to both TrackMenu usages
- FavoritesView: Added download submenu to both track list variants
- Downloaded tracks now show submenu with 'Open containing folder' and 'Re-download' options
- Completes Phase 2 Task 2.1: Context Menu Homogenization (Download)
Added Download menu item with submenu for downloaded tracks:
- If not downloaded: Shows 'Download' button
- If downloaded: Shows 'Download' submenu with:
- 'Open containing folder' (onOpenFolder)
- 'Re-download' (onReDownload)
New props added to TrackMenu:
- onDownload: Download track
- isTrackDownloaded: Boolean to determine if track is downloaded
- onOpenFolder: Open folder containing downloaded track
- onReDownload: Re-download track
Matches pattern used in AlbumMenu.svelte for albums.
Removed special case that forced ALAC to use symphonia fallback which
decoded the entire file (~30MB) before playback, causing 6+ second delays.
Now ALAC uses rodio's Decoder first (supports ALAC via symphonia-all
feature) which streams instead of decoding everything upfront.
Fallback chain is now:
1. Rodio Decoder (streaming) - instant
2. MP4 fallback (streaming) - instant
3. Symphonia (full decode) - slow, last resort
This brings ALAC playback start time from ~6 seconds to instant,
matching FLAC and other formats.
ALAC files (and some other formats) don't include channel information in
the initial codec params, causing playback to fail with error:
'No channel info in codec params'
Changed to use .unwrap_or(2) instead of .ok_or_else() to default to
stereo (2 channels) which is the most common case and matches the
behavior in metadata extraction.
Fixes playback of ALAC (.m4a) files in Local Library.
Fixed missing type annotations in row.get() calls for sample_rate.
Without explicit type annotation, Rust was inferring the wrong type
causing 'Invalid column type Real' errors when reading from database.
Added ::<_, f64> type annotation to all three locations:
- row_to_track (line 1168)
- get_playlist_local_tracks (line 1772)
- get_playlist_local_tracks_with_qobuz (line 1821)
This is the critical fix for the database migration error.
Changed LocalAlbum.sample_rate from u32 to f64 to match database REAL type.
Fixed database queries to read sample_rate as f64 instead of u32.
Removed incorrect i64 casts when inserting sample_rate values.
This fixes the 'Invalid column type Real' error that prevented the app
from loading after the database migration.
Drop any existing local_tracks_new table before starting migration
to handle cases where a previous migration attempt failed mid-execution.
This prevents 'table already exists' errors when retrying the migration.
Use COALESCE in migration SELECT to safely handle NULL file_size_bytes
values that may exist in older database versions. This prevents the
'NOT NULL constraint failed' error when migrating from INTEGER to REAL
sample_rate type.
The migration now uses COALESCE(file_size_bytes, 0) to ensure all
rows have a valid file size value, defaulting to 0 for missing data.
Fixes critical migration failure that prevented app startup for users
with existing databases.
1. QUEUE SHUFFLE FIX (CRITICAL):
- When shuffle enabled and set_queue called, starting track was placed randomly in shuffle_order
- This caused queue UI to show only tracks AFTER that random position
- Example: 11 tracks, start at index 5, but index 5 was at position 7 in shuffle → only 3 tracks visible
- FIX: When shuffle enabled, swap starting track to position 0 in shuffle_order
- Now all tracks appear in queue UI as expected
2. LOCAL LIBRARY CONTEXT FIX:
- handleLocalTrackPlay was clearing context immediately after LocalLibraryView set it
- FIX: Removed clearPlaybackContext() call - LocalLibraryView handles context correctly
- Context icon should now display for Local Library playback
3. SAMPLE RATE CRASH FIX:
- show_track_notification expected u32 but received f64 (44.1, 88.2, etc.)
- Error: "invalid type: floating point 44.1, expected u32"
- FIX: Changed sample_rate parameter from u32 to f64 in notification command and format_quality
- Bonus: Format shows "44.1" for fractional rates, "48" for whole numbers
Files modified:
- src-tauri/src/queue/mod.rs - Fixed set_queue to move start_index to front of shuffle_order
- src/routes/+page.svelte - Removed clearPlaybackContext from handleLocalTrackPlay
- src-tauri/src/commands/notification.rs - Changed sample_rate to f64 with proper formatting
- Modified handleShuffleAlbum to pick random starting track (same fix as Local Library)
- Added comprehensive debug logs to handleAlbumTrackPlay to diagnose queue issues
- Fixed favoritesStore crash when response.tracks is undefined (defensive checks)
Fixes:
- Qobuz album shuffle no longer always starts with first track
- App no longer crashes on startup with "undefined is not an object (evaluating 'response.tracks.items')"
- Modified handleShuffleAllAlbum to pick random starting track instead of always starting with first
- Added comprehensive debug logs to track queue creation and size
- Logs will help diagnose why only 1-3 tracks appear in queue UI instead of all tracks
Multiple critical fixes for context tracking:
1. Add 'local_library' to backend context type parser
- Was rejecting 'local_library' causing "Invalid context type" error
- Now properly recognized in set_playback_context command
2. Fix shuffle to not always start with first track
- Removed logic that moved current track to front of shuffle
- Now finds current track position in shuffled order instead
- Shuffle is truly random, not biased to original order
3. Add missing await to all setPlaybackContext calls
- PlaylistDetailView: await context creation
- FavoritesView: make setFavoritesContext async + await calls
- ArtistDetailView: await context creation
- HomeView: await context creation
- SearchView: await + use home_list type (search type doesn't exist)
This fixes intermittent context tracking (race condition)
Fixes: shuffle starting with first song, Local Library context error,
intermittent playlist/favorites/artist/home/search context tracking
cc
Add proper context tracking for Local Library playback so the stack
icon shows correctly when playing from Local Library.
Changes:
- Add 'local_library' to ContextType enum (frontend and backend)
- Add 'Local Library' display label in context info
- Import setPlaybackContext in LocalLibraryView
- Call setPlaybackContext when playing tracks from Local Library
- For album view: context is the album with album title
- For tracks view: context is "Local Tracks"
- Track IDs and position are properly set for context navigation
Fixes issue where Local Library playback showed stale Qobuz context.
cc
Add shuffle functionality to Local Library album view with button
that enables shuffle mode before playing all tracks.
Changes:
- Import Shuffle icon from lucide-svelte
- Add handleShuffleAllAlbum function
- Add shuffle button next to Play All button
- Add shuffle-btn CSS styling matching secondary button pattern
cc
Previous implementation had a critical bug in the shuffle algorithm
that used the same seed value for all iterations, resulting in
weak/predictable shuffling.
Changes:
- Add rand crate dependency for proper PRNG
- Fix Fisher-Yates to use unique random value per iteration
- Use StdRng with timestamp-based seed for reproducible randomness
- Each shuffle iteration now gets a new random number from the RNG
This fixes shuffle working inconsistently across different contexts
(albums, playlists, continuous play).
cc
Add comprehensive Flatpak section with:
- Warning about PipeWire bit-perfect limitations in sandbox
- Instructions for ALSA Direct workaround
- NAS/network storage access commands (flatpak override)
- Note in Audio Backends section about Flatpak restrictions
This helps users make informed installation choices before downloading.
Display warning banner in Settings when user enables DAC Passthrough
with PipeWire backend in Flatpak environment.
The warning informs users that:
- PipeWire cannot guarantee bit-perfect in Flatpak sandbox
- ALSA Direct backend is recommended for true bit-perfect audio
This addresses the fundamental limitation where Flatpak portal does
not allow control of PipeWire daemon sample rate configuration, even
with elevated permissions.
Two critical fixes for Flatpak sandbox environment:
1. PipeWire detection now uses pactl instead of pw-cli
- pw-cli is not available in GNOME Flatpak runtime
- pactl works for both PipeWire and PulseAudio (compatibility layer)
- Fixes missing PipeWire backend in Settings
2. App ID migration now works in Flatpak sandboxes
- Detects Flatpak environment and uses absolute paths
- Accesses old sandbox (com.blitzkriegfc.qbz) via HOME directory
- Added read-only permission to old App ID in manifest
- Properly migrates config/data/cache from old to new sandbox
BREAKING CHANGE: App ID changed from com.blitzkriegfc.qbz to com.blitzfc.qbz
Changes:
- Renamed Flatpak App ID and all metadata files
- Fixed MPRIS name: qbz_nix → qbz
- Added NAS support permissions: /mnt, /media, /run/media
- Updated CI workflow for new filenames
- Updated tauri.conf.json bundle identifier
Flatpak features:
- Runtime detection (/.flatpak-info check)
- Automatic data migration from old App ID
- Migrates config, data, and cache directories
- Non-destructive (preserves old directories)
- Runs on startup before any other initialization
- New Settings section (Flatpak-only)
- Filesystem permission guidance
- Copy-paste ready commands for NAS/SSHFS
- Professional UX per Flatpak best practices
Migration is automatic and transparent for existing users.
Features:
- New Settings section that appears ONLY when running in Flatpak
- Displays clear instructions for granting filesystem permissions
- Copy-paste ready commands for common scenarios (NAS, SSHFS)
- Explains Flatseal as GUI alternative
- Professional, defensive UX per prompt requirements
The section is completely hidden when not in Flatpak.
Users see actionable guidance with examples.
Features:
- Flatpak runtime detection (/.flatpak-info check)
- Automatic migration of user data from old App ID to new ID
- Config: ~/.config/com.blitzkriegfc.qbz → ~/.config/qbz
- Data: ~/.local/share/com.blitzkriegfc.qbz → ~/.local/share/qbz
- Cache: ~/.cache/com.blitzkriegfc.qbz → ~/.cache/qbz
- Migration runs on startup before any other initialization
- Old directories are preserved (manual cleanup required)
- Tauri commands for frontend integration:
- is_running_in_flatpak()
- get_flatpak_help_text()
Migration is non-destructive and idempotent.
Changes:
- Renamed Flatpak manifest, desktop file, and AppStream metainfo
- Updated App ID in all metadata files
- Fixed MPRIS name: qbz_nix → qbz
- Added NAS support permissions: /mnt, /media, /run/media
- Updated CI workflow to use new filenames
- Updated tauri.conf.json bundle identifier
BREAKING CHANGE: Users will need to migrate data from old App ID directories
Data migration will be implemented in next commit
Implements native ALSA hw: device support for bit-perfect playback with:
- Direct PCM access bypassing PipeWire/Pulse resampling
- Automatic format detection (S16_LE, S24_LE, S32_LE, FLOAT_LE)
- Optional hardware mixer volume control via ALSA
- HW badge indicator for ALSA Direct mode
- DAC badge improvements with device name tooltip
- Lightweight hardware status polling for sample rate verification
Database migrations are safe for existing users (1.1.5+):
- alsa_hardware_volume column added with NULL-safe handling
- Defaults to disabled for backwards compatibility
UI improvements:
- Improved ticker animation on album cards and tooltips
- Badge tooltip shows actual device name with scrolling
- Fixed badge width consistency across quality types
Changes:
- Reduced speed from 80 to 40 pixels per second for better readability
- Added typewriter-style animation with pauses and fast return
- Slow scroll (50% of time), pause, then quick return (10% of time)
IMPORTANT FOR MERGE: If this conflicts with other branches modifying the same animation, THIS VERSION should be kept as it provides better UX (tested and approved by user).
Adds scrolling animation when device names overflow tooltip width, borrowed from AlbumCard component pattern. Also fixes accessibility warning by adding role and aria-label to badge container.
The 1s polling of get_hardware_audio_status was logging every second:
"Hardware audio status: 192000Hz, format: Some("S32_LE")"
This is useful for debugging but too noisy for normal usage.
Change:
- log::info! → log::debug! (line 52)
Result:
- Console stays clean during playback
- Log still available with RUST_LOG=debug for debugging
- Polling continues working, just silently
This reverts the event-driven approach (9242b95) and restores lightweight
polling, but ONLY for hardwareStatus.
Problems with event-driven approach:
1. False yellow warnings: hardwareStatus had stale data from previous song
- Hardware: 88200 Hz (correct)
- Cached hardwareStatus: 44100 Hz (from previous song)
- Badge logic: 88.2 !== 44.1 → WARNING (false positive)
2. Lost device name: outputStatus never updated after mount
- loadStatus() only called once on mount
- outputStatus.device_name became stale
- Badge tooltip showed "Default" instead of "hw:4,0"
Solution - Lightweight polling (best of both worlds):
- Call loadStatus() once on mount (loads everything)
- Poll ONLY hardwareStatus every 1s (no device enumeration)
- get_hardware_audio_status just reads /proc/asound (very cheap)
- No CPAL device enumeration (no console spam)
- No get_pipewire_sinks calls (no ALSA errors)
Benefits:
- Badge always shows current hardware status (accurate resampling detection)
- Device name preserved (loaded once, doesn't change)
- Zero console spam (no device enumeration)
- Very lightweight (just read /proc/asound file)
- ~1000x cheaper than full loadStatus() polling
This gives us accurate bit-perfect validation without the overhead.