Commit Graph
13 Commits
Author SHA1 Message Date
vicrodh 700dc07014 fix(library): improve artist consolidation and album matching
- Add all_artists field to LocalAlbum for accurate artist matching
- Consolidate duplicate artists with case differences (e.g., "Alice in Chains" / "Alice In Chains")
- Fix album count calculation to avoid double-counting
- Show Various Artists albums under contributing artists
- Handle multi-artist names (e.g., "A, B, C") with union matching
- Add cleanup missing files feature in settings maintenance section
- Improve settings UI with side-by-side Maintenance/Danger Zone layout
- Add status indicator during cleanup operations
2026-01-28 08:13:07 -06:00
vicrodh e8f0c96ccc feat(library): add source badge to album cards in Local Library
Albums now show a small badge indicating their source:
- HardDrive icon for local files (source='user')
- Qobuz logo for offline cached content (source='qobuz_download')

Badge appears in bottom-right corner of album artwork.
2026-01-28 02:40:00 -06:00
vicrodh 2270d80139 Add source/qobuz_track_id to LocalTrack model and implement filtering for Artists/Tracks
- Added source and qobuz_track_id fields to LocalTrack model for proper filtering
- Updated all database row mapping functions to include new fields
- Implemented network folder and download filtering for library_get_artists command
- Implemented network folder and download filtering for library_search (Tracks) command
- Made tab counters (Albums, Artists, Tracks) reactive to filtered content
- Counters now update based on current filtered data instead of total stats

Fixes offline mode filtering for Artists and Tracks tabs. When offline or when
downloads are hidden, Artists/Tracks now properly filter out inaccessible content,
matching the behavior already implemented for Albums.
2026-01-20 01:26:27 -06:00
vicrodh 88d4bc8471 Fix sample_rate type mismatches for LocalAlbum and inserts
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.
2026-01-19 20:14:09 -06:00
vicrodh 1e7475e308 Fix sample rate decimal precision for bit-perfect playback (CRITICAL)
Problem:
- sample_rate stored as INTEGER in DB and u32 in Rust
- Fractional rates (44.1, 88.2, 176.4 kHz) stored as 44100, 88200, 176400 Hz
- Integer division (44100 / 1000 = 44) lost decimals
- DAC badge showed "resampling 44 → 44.1 kHz" false positive
- Breaks bit-perfect guarantee - user requirement: "no es negociable"

Root Cause:
- DB schema: sample_rate INTEGER (44100 Hz)
- Frontend: Math.round(44100 / 1000) = 44 kHz (lost .1)
- Badge: Compared 44 kHz vs 44.1 kHz → false resampling warning

Solution:
1. Changed LocalTrack.sample_rate from u32 to f64 (models.rs)
2. Changed AudioProperties.sample_rate from u32 to f64 (models.rs)
3. Changed DB schema from INTEGER to REAL (database.rs)
4. Added migration to convert existing data (database.rs)
5. Updated metadata extraction to cast to f64 (metadata.rs)
6. Fixed frontend to use float division without rounding (+page.svelte)

Migration:
- Checks if sample_rate is INTEGER
- Creates temp table with REAL, copies data, drops old, renames
- Preserves all data and indexes
- Runs automatically on app start

Result:
- 44100 Hz stored as 44100.0
- Division: 44100.0 / 1000.0 = 44.1 kHz (exact)
- Badge: 44.1 kHz = 44.1 kHz → no resampling (correct)
- Bit-perfect guarantee restored

Files modified:
- src-tauri/src/library/models.rs - Changed sample_rate to f64 in structs
- src-tauri/src/library/metadata.rs - Cast sample_rate to f64
- src-tauri/src/library/database.rs - Changed schema to REAL + migration
- src/routes/+page.svelte - Fixed division to preserve decimals
2026-01-19 19:49:34 -06:00
vicrodh 279d433b77 Add catalog number support for precise Discogs searches
- Added catalog_number field to LocalTrack and LocalAlbum models
- Extract catalog_number tag from audio files using lofty
- Database migration to add catalog_number column to local_tracks table
- Modified Discogs search to prefer catalog number over artist/album
- Updated UI to display catalog number in album details
- Pass catalog_number to discogs_search_artwork command

For audiophile users with well-tagged libraries, catalog numbers
provide more precise Discogs search results than artist + album.
2026-01-17 00:34:27 -06:00
vicrodh 16486e4591 Fix playlist track ordering to respect insertion order
- Add PlaylistLocalTrack struct with playlist_position field
- Add playlist_get_local_tracks_with_position command
- Update PlaylistDetailView to merge tracks by position instead of
  appending local tracks at the end
- Update PlaylistModal to calculate correct position when adding local
  tracks (total count = qobuz + existing local)
- Local tracks now appear in the order they were added, interleaved
  with Qobuz tracks
2026-01-16 07:04:21 -06:00
vicrodh 3eb80c7840 feat(library): remove album limit and add album hide feature
- Remove 100 album cap from library_get_albums query
- Add album_settings table with hidden flag per album
- Add commands to hide/show albums
- Add UI toggle in settings to view hidden albums
- Add hide button to album list view
- Update LocalLibraryView to support hidden albums view

cp
2026-01-14 14:57:58 -06:00
vicrodh b8e3bca6f8 feat(settings): separate toasts and system notifications toggles
- Split "Notifications" setting into "In-app Toasts" and "System Notifications"
- In-app toasts control the toast messages within the app
- System notifications control desktop notifications on track change
- Both settings persist to localStorage and load on app startup
- Migrates old 'qbz-notifications-enabled' key to new 'qbz-toasts-enabled'

feat(library): add stop scanning button

- Add library_stop_scan command in Rust backend
- Add cancel flag (AtomicBool) to LibraryState
- Check cancel flag during scan loop for both CUE and audio files
- Add "Cancelled" status to ScanStatus enum
- Add stop button in LocalLibraryView scan progress UI
- Button appears red on hover for clear visibility

cc
2026-01-14 08:05:13 -06:00
vicrodh d4716af0d2 feat(library): allow mp3 in local library 2026-01-14 01:47:34 -06:00
vicrodh b22dd9e7e4 feat(library): group multi-disc albums by folder 2026-01-13 10:19:12 -06:00
vicrodh e8a61a45ce feat(library): improve local library UX and audio metrics
- Move Local Library section below Playlists in sidebar (Qobuz is main B.U.)
- Replace text input with native XDG folder picker dialog
- Add bit_depth and sample_rate to LocalAlbum model
- Display rich audio specs in album detail view (format, bit depth, sample rate, channels)
- Show format quality badge on album cards (e.g. "FLAC 24/96")
- Add Hi-Res visual indicator for 24-bit or >48kHz content
2026-01-09 14:05:17 -06:00
vicrodh 1895812830 feat(library): integrate local library module from Codex
Full local library implementation with:
- Filesystem scanner for FLAC, WAV, AIFF, APE, ALAC files
- Metadata extraction using lofty crate
- CUE sheet parsing for single-file albums
- SQLite persistence with WAL mode
- 13 Tauri commands for library management

Commands:
- library_add_folder, library_remove_folder, library_get_folders
- library_scan, library_get_scan_progress
- library_get_albums, library_get_album_tracks, library_get_artists
- library_search, library_get_stats, library_clear
- library_get_track, library_play_track (with CUE seek support)

Based on implementation by Codex in local-library worktree.
2026-01-09 13:23:32 -06:00