Add the Music Library plugin (+ universal workspace scoping) #33
Loading…
Reference in a new issue
No description provided.
Delete branch "music-library-plugin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Garnet's second plugin — a local music player built on the Workspace + Workflow model — plus the base groundwork it needed. This is the first catalog-backed plugin: its Workflow reads the indexed library (not an OS working folder), which generalized the working-folder capability to every workspace type.
Base groundwork
AssetQuery.under_pathfolder filter and aworkspaceScopeQueryhelper.lofty— audio assets getaudio.{title,artist,album,album_artist,track,disc,year,genre,duration_secs,sample_rate,bit_depth,channels,has_cover}rows, surfaced on the detail page for everyone. The scan backfills metadata for already-indexed files (version-aware for audio) so existing libraries pick up new fields on the next scan.The plugin (
music, default-enabled)backend/src/music/—list_music_library(Rust-side album/artist grouping),load_album_art(embedded → folder-cover fallback, cached), a native Rust player (Symphonia + Rodio, adapted from Starling — WebKitGTK chops compressed audio on Linux),get_audio_peaks+prewarm_peaks(cached under\$XDG_CACHE_HOME/garnet/peaks/, never written into the user's music folders).src/plugins/music/— album-cover grid / artist sections → album detail (blurred backdrop, quality chips, Hi-Res badge, track table with hover-to-play + animated now-playing indicator) → a persistent global player (mounted via a new pluginglobalslot, survives leaving the workspace) with a lazy-loadedwavesurfer.jswaveform, shuffle/repeat modes, and an up-next queue panel.Perf
opt-level = 3for the audio-decode crates in the dev profile, and the peaks decode runs on the blocking pool — so first-play isn't stalled by a full-file decode.prewarm_peakswarms the cache in the background so first-play is instant.Notes
libasound2-dev(cpal), now probed bymake setup.make lint typecheck testis green: 127 Rust tests + 13 frontend tests.