Skip to content

fix(locallibrary): plugins on folder drives, plugin fields in rules and edits, panel leftovers - #315

Merged
botandbang merged 2 commits into
mainfrom
bnb/player-plugins
Nov 1, 2026
Merged

botandbang merged 2 commits into
mainfrom
bnb/player-plugins

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

What and why

Plugin hooks now run on a drive the player (or any command) opened by folder path. A hook's context gives its plugin that drive, under the name the context uses, until the hook ends. Callbacks find it by that name before the drives known here. Paths, other folders, and the folder after the hook are still refused, and paths under it are said from its name. Exports give the drive again while the plugin writes. The player's "only on a plugged-in drive" gating is removed, along with Target.folder_drive and the panel's unavailable state.

Smart playlist rules, edits' track selectors and playlist sorts on the drive take analyzers' fields. The app's Installed moved into the library as fields::Installed. Edit planning reads field values when a selector or sort names one, through the hosted plugins and the default store. Rules are validated against the fields the installed plugins declare, when they're added and when they're applied. A field no plugin declares says so, and a filter on a field nothing has been analyzed for warns in the plan. The player's "sort on the drive" works for a plugin column.

The player reads a track's analysis and harmonic matches through api::analysis_of and api::matches_in, which track.analysis, track.show and track.matches use too.

Plugin panels in the player show their view's own title after the panel's, as track show does, and are asked for again when their plugin's settings are saved.

Fixes LOC-26
Fixes #126
Fixes LOC-25
Fixes #125
Fixes LOC-27
Fixes #127
Fixes LOC-20
Fixes #117

How it was tested

  • cargo fmt --check, and cargo clippy -p locallibrary -p locallibrary-cli --all-targets -- -D warnings.
  • cargo nextest run -p locallibrary on the plugin, query, smart, edit, fields, analysis, matches and api property tests: 604 pass. cargo nextest run -p locallibrary-cli on the player's plugin, props, mix, edits and My Tags tests and the plugin, smart, rpc, edit, tracks and playlist tests: 409 pass.
  • New tests, each broken once and seen to fail: a_hook_on_a_folder_reads_only_that_folder (a real plugin process on a folder outside the volumes; fails with callbacks back on reads.drive), the three plugins/fields.rs tests (all fail with the field reading off), and a_panel_shows_its_views_title_and_follows_its_settings (fails without the stale call). LOC-27 is a structural change, pinned by the details property comparing against api::matches_in.
  • The panel heading checked on a dumped screen at 160 and 80 columns.
  • Not run: the full suite and Windows clippy.

Checklist

  • Tests cover the change
  • For locallibrary: apps/locallibrary/CHANGELOG.md has a line under Unreleased, if people using it will notice
  • The READMEs, docs/ and --help still say what the code does

…nd edits, panel leftovers

Planned as these commits, folded into one because they share files:

- fix(locallibrary): let a plugin hook read the folder drive it runs on, and only while it runs
- feat(locallibrary): take analyzers' fields in smart rules, edit selectors and drive sorts
- refactor(locallibrary): read the player's analysis and matches through the api
- fix(locallibrary): title plugin panels as track show does and ask again when settings change
@botandbang
botandbang requested a review from bnb as a code owner October 30, 2026 16:17
@linear-code

linear-code Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

LOC-27

LOC-25

LOC-20

LOC-26

bnb
bnb previously approved these changes Oct 30, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation locallibrary locallibrary and the loclib-* crates locallibrary: cli The locallibrary command line locallibrary: player The terminal player and its waveforms locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: mixes Finding the tracks a recorded mix plays, and mix reports locallibrary: plugins The plugin protocol, its host and the built-in plugins tests Tests, fixtures and test harnesses labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 680.7 KiB 680.7 KiB 0 B (0%)
Client JavaScript, brotli 226.8 KiB 226.8 KiB 0 B (0%)
Client CSS 89.6 KiB 89.6 KiB 0 B (0%)
Client CSS, brotli 12.9 KiB 12.9 KiB 0 B (0%)

# Conflicts:
#	apps/locallibrary/CHANGELOG.md
#	apps/locallibrary/src/tui/plugins.rs
#	crates/locallibrary/src/plugin/imports.rs
#	crates/locallibrary/src/plugin/sources.rs
@botandbang

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs against current main (with #353's CodeQL fix). Branch unchanged.

@botandbang botandbang closed this Nov 1, 2026
auto-merge was automatically disabled November 1, 2026 16:49

Pull request was closed

@botandbang botandbang reopened this Nov 1, 2026
@botandbang botandbang closed this Nov 1, 2026
@botandbang botandbang reopened this Nov 1, 2026
@botandbang
botandbang enabled auto-merge November 1, 2026 16:50
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Rust coverage

From run 36. Both are held to the thresholds in .cargo/config.toml.

Tests Lines Functions Regions
All 97.4% (84516/86774) 96.53% (13539/14025) 95.67% (186083/194509)
Hegel property tests alone 95.36% (82748/86774) 94.07% (13194/14025) 93.44% (181748/194509)

@botandbang
botandbang added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 1377664 Nov 1, 2026
62 of 66 checks passed
@botandbang
botandbang deleted the bnb/player-plugins branch November 1, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation locallibrary: cli The locallibrary command line locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: mixes Finding the tracks a recorded mix plays, and mix reports locallibrary: player The terminal player and its waveforms locallibrary: plugins The plugin protocol, its host and the built-in plugins locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses

Projects

None yet

2 participants