push-yynluqyruopn #176

Merged
eric merged 28 commits from push-yynluqyruopn into main 2026-11-11 13:21:44 +01:00
Owner
No description provided.
eric added 28 commits 2026-11-11 13:14:39 +01:00
Implemented robust WebSocket connection handling, silence detection, and local command logic for player interaction.
Update the `windows-sys` dependency across multiple packages to various older versions (0.48.0, 0.59.0, 0.52.0) and fix its checksum. Change the `pmoutils` package source from a sparse URL to a standard registry URL.

- Update `windows-sys` version from 0.61.2 to 0.48.0 in multiple packages
- Update `windows-sys` version from 0.61.2 to 0.59.0 in one package
- Update `windows-sys` version from 0.61.2 to 0.52.0 in several packages
- Update checksum for `windows-sys` dependency
- Change `pmoutils` source URL from sparse to standard registry
- Delete the standalone `pmossdp` crate (Cargo.toml, src/lib.rs, client.rs, device.rs, server.rs) as its functionality is being integrated into the workspace.
- Remove `.cargo/config.toml` which previously defined the local registry index; this configuration is now generated dynamically by `.crate-kit`.
- Add `.crate-kit/` directory containing `VERSION`, `crate.mk`, `dev-patch.mk`, and `jj.mk` to manage build, patching, and versioning workflows.
- Add `.crate-kit/scripts/` with utilities for API snapshots (`api-level.sh`, `api-snapshot.sh`), version bumping (`bump-version.sh`), publishing (`publish.sh`), release notes, tagging, wiki updates, and Forgejo releases.
- Update `Cargo.toml` to include `pmossdp` as a workspace dependency (v0.1) and update `pmoutils` to v0.2.1.
- Configure `pmoconfig`, `pmocontrol`, `pmopcmagent`, `pmoreaders`, and `pmoupnp` to use `pmossdp` and `pmoutils` as workspace dependencies instead of path dependencies.
- In `pmoconfig/src/lib.rs`, add `guessed_base_url()` to return `127.0.0.1` on failure and update `get_base_url()` to log warnings and use the new guesser.
- Update `pmopcmagent/src/main.rs` to simplify IP parsing error handling.
- Update `pmoupnp/src/devices/device_instance.rs` to use `pmoutils::guess_local_ip()` with a fallback to "localhost".
- Update Dockerfiles (`Dockerfile`, `pmosound/debian/Dockerfile`) to set `CARGO_REGISTRIES_PMO_INDEX` and remove local `pmossdp` copy instructions.
- Update `Makefile` to include `.crate-kit/dev-patch.mk` in the `blackboard-clean` target for patch regeneration.
Update version to 0.1.5, refresh dependencies in Cargo.lock, and introduce a new `jjfetch.sh` script to handle fetching and rebasing local work against `main@origin`. Refactor Makefiles to use the new script and ensure `.crate-kit` synchronization, while adding stability filtering logic to `api-level.sh`.

- Update `.crate-kit/VERSION` from 0.1.3 to 0.1.5
- Add `.crate-kit/scripts/jjfetch.sh` to fetch and rebase local work against `main@origin`, handling mutable revisions and conflicts
- Modify `.crate-kit/jj.mk` to define `JJ_KIT_DIR` and use the new `jjfetch.sh` script instead of inline commands
- Update `Makefile` to synchronize `.crate-kit/` from `crate-kit` before other targets and update `jjfetch` target
- Add `filtre_instable` function in `.crate-kit/scripts/api-level.sh` to filter unstable `Freeze` impls from diff output
- Update `Cargo.lock`: bump `windows-sys` to 0.59.0, `pmossdp` to 0.1.1, `pmoutils` to 0.2.3; remove `libc` and `chrono` from `pmossdp`
Replace the scattered `base_url` and `http_port` fields with a unified `ServerUrl` struct to simplify initialization and access. Update `pmoserver` to use `GLOBAL_URL` for global state, removing the `futures` dependency and updating other crate versions.

- Add `pmoserver/src/server_url.rs` containing the new `ServerUrl` struct with fields `base_url` and `http_port`, along with methods `new`, `http_port`, `configured`, `base_url`, and `request_base_url`.
- Update `pmoserver/src/server.rs` to store a `url: ServerUrl` in the `Server` struct, replacing separate `base_url` and `http_port` fields; update `new`, `start`, `info`, `request_base_url`, and `base_url` methods to use the new struct.
- Modify `pmoserver/src/lib.rs` to initialize `GLOBAL_URL` as a `OnceCell<ServerUrl>` and update `get_request_base_url` and `get_server_base_url` to read from it, removing locking on `GLOBAL_SERVER`.
- Remove the `futures` dependency from `Cargo.lock` and `pmoserver/Cargo.toml`, while updating versions for `async-stream`, `rust-embed`, and `mime_guess`.
- Update version number in `.crate-kit/VERSION` from 0.1.5 to 0.1.6.
Update itertools to 0.13.0 and pmossdp to 0.1.2. Refactor `handle_ssdp_event` to explicitly handle `ByeBye` events and add a catch-all case. Update `pmocontrol` example to print detailed `ByeBye` data and add an `other` arm for unknown events.

- Update Cargo.lock: itertools 0.12.1 -> 0.13.0, pmossdp 0.1.1 -> 0.1.2
- Modify `handle_ssdp_event` in `upnp_discovery.rs`: add `ByeBye` case returning specific tuple, add `_` catch-all returning immediately
- Update `dump_ssdp.rs`: `ByeBye` arm prints `from`, `usn`, `nt`; add `other` arm printing unknown events
- Refactor `pmopcmagent/src/main.rs`: use `.without_root_device()` on `SsdpDevice::new()`, remove explicit `notification_types` setting, update device format string with `CARGO_PKG_VERSION`
- Update `config.yaml`: refresh `last_seen` timestamps for `testdevice` and `mediarenderer`
Introduce a new `deps-check` script and Makefile targets to validate PMO dependencies against the latest published versions. Update the CI pipeline and release scripts to enforce these checks before version bumps or releases.

- Add `.crate-kit/scripts/deps-check.sh` with functions `bad`, `index_path`, `latest_published`, `req_accepts`, `req_for`, and `lock_entries` to check and bump PMO dependencies.
- Update `.crate-kit/dev-patch.mk` to expose `deps-check` and `deps-bump` phony targets that invoke the new script.
- Modify `.crate-kit/crate.mk` to run `deps-check` in the 'watch' CI pipeline, before version bumps in 'jjpush', and before checkout/bumping in 'jjrelease'.
- Update Makefile's `ci:` target to include `deps-check` alongside existing checks like `fmt-check`, `clippy`, and `test`.
- Bump `pmossdp` dependency version from 0.1.2 to 0.2.0 in `Cargo.lock` and from 0.1 to 0.2 in `Cargo.toml`.
Split `pmoconfig` into a core library and an application-specific crate `pmomusic-config`. Move host configuration to `pmoserver`, device storage to `pmomusic-config`, and encryption to use app-specific salts.

- Add `pmomusic-config` crate for PMOMusic-specific defaults, device management (`DevicesConfigExt`), and storage paths (`StorageConfigExt`).
- Split `pmoconfig` into `config.rs` (core `Config` struct and YAML handling), `global.rs` (process-wide init/get), and `spec.rs` (app identification).
- Move host configuration logic (`HostConfigExt`) from `pmoconfig` to `pmoserver/src/host_config.rs`.
- Update encryption to require `AppSpec` for key derivation, ensuring separation between applications.
- Refactor all dependent crates (`pmoaudiocache`, `pmocovers`, `pmoident`, etc.) to use the new configuration loading and extension traits.
Update PMO Sound to use the new `AppSpec` configuration system, replacing the legacy `pmomusic_config` loading patterns with dedicated application specifications. This involves updating environment variables, systemd units, and internal initialization logic to use `PMOSOUND_CONFIG` and `load_app`.

- Replace `pmomusic_config::init_with_default` and `load_config` calls in `main.rs`, `config_ext_tests.rs`, and `sound_tests.rs` with `pmomusic_config::init_app` and `load_app` using `config_ext::spec()`.
- Update `pmoconfig/src/spec.rs` to use "MONAPP" prefix for salt derivation tests and add `salts_follow_the_prefix`; remove `salts_of_pmomusic_are_frozen`.
- Modify `pmoconfig/src/encryption.rs` to test documented SHA-256 key derivation, replacing `test_pmomusic_key_is_the_historical_one` with `test_key_is_the_documented_derivation`.
- Update `pmosound/debian/pmosound.service` and `pmosound/pi/test.sh` to use `PMOSOUND_CONFIG` environment variable and fix `HOME` in tests.
- Add `spec()` function in `pmosound/src/config_ext.rs` returning an `AppSpec` for "PMOSOUND" with `DEFAULT_CONFIG`.
Remove the `pmoconfig` crate entirely, replacing its functionality with workspace dependencies. Update `.crate-kit` scripts to support external dependency checking and refactor shared logic into dedicated libraries.

- Delete the `pmoconfig` crate (Cargo.toml, README.md, src/api.rs, src/config.rs, src/config_tests.rs, src/encryption.rs, src/error.rs, src/global.rs, src/lib.rs, src/openapi.rs, src/spec.rs, src/typed.rs)
- Move `filtre_instable` from `.crate-kit/scripts/api-level.sh` to `.crate-kit/scripts/common.sh`
- Move `index_path`, `latest_published`, `lock_entries`, `req_accepts`, and `req_for` from `.crate-kit/scripts/deps-check.sh` to the new `.crate-kit/scripts/deps-lib.sh`
- Add `.crate-kit/scripts/deps-check-external.sh` for checking external dependencies against crates.io
- Update Makefile to export `DEPS_CHECK_EXTERNAL = 0` and update `KIT_SRC` default
- Update `.crate-kit/VERSION` from 0.1.6 to 0.1.8
- Update Dockerfile to copy `pmomusic-config` instead of `pmoconfig`
- Change `pmoconfig` dependency in all crates (e.g., PMOMusic, pmoaudiocache, pmoauth, pmobbc, pmocache, pmocovers, pmoident, pmomediarenderer, pmomediaserver, pmomultiroom, pmomusic-config, pmoparadise, pmoplaylist, pmoqobuz, pmoradiofrance, pmoreaders, pmoserver, pmosound, pmosource, pmouniverse, pmouniverse-fill, pmouniverse-identify, pmoupnp, pmowebrenderer, pmoyoutube) to use `workspace = true`
- Update Cargo.toml root dependencies: add `pmoconfig` from registry, update `r2d2_sqlite` and `tokio-test` versions
- Add TODO.md section documenting external dependency issues and upgrade requirements
Update test suite to use smaller, seekable audio files instead of large
full-length tracks. This improves test execution speed and reliability.
Add new test data files for FLAC, MP3, Ogg Vorbis, and Opus formats.

- Add `pmoflac/test_data/sine_16bit_44100.flac` as a small 16-bit FLAC sine wave sample.
- Add `pmoflac/test_data/seek/cbr.mp3` as a constant bitrate MP3 test file.
- Add `pmoflac/test_data/seek/vorbis.ogg` as an Ogg Vorbis test file for seeking verification.
- Add `pmoflac/test_data/stereo_sine.opus` as a stereo Opus sine wave sample.
- Update `auto_decode.rs` to use new seekable MP3 and other small samples in `SAMPLE_FILES`.
- Update `flac_streams.rs` to read from the new 16-bit FLAC sine file in `decode_stream_info_16_44` and `decoder_streams_without_buffering_all_input`.
- Update `mp3_decode.rs` to use the new seekable MP3 file for `TEST_MP3`.
- Update `ogg_decode.rs` to use the new Ogg Vorbis file for `TEST_OGG`.
- Update `opus_decode.rs` to use the new stereo Opus file for `TEST_OPUS`.
- Add `.gitignore` rules to exclude the new test data files from version control.
Replace `serde_yaml` with `serde_yaml_ng` across the workspace and update `utoipa` from version 5 to 6. This involves updating dependencies in all `Cargo.toml` files, replacing imports and type usages in source code, and adjusting configuration handling logic to use the new library's API.

- Update `serde_yaml` to `serde_yaml_ng` (v0.10) in root `Cargo.toml` and all sub-crates (`pmoaudiocache`, `pmoauth`, `pmobbc`, `pmocache`, `pmocontrol`, `pmocovers`, `pmodidl`, `pmoident`, `pmomultiroom`, `pmomusic-config`, `pmoparadise`, `pmoplaylist`, `pmoqobuz`, `pmoradiofrance`, `pmoreaders`, `pmoserver`, `pmosound`, `pmosource`, `pmouniverse`, `pmoupnp`, `pmoyoutube`).
- Update `utoipa` dependency from v5 to v6 in all crates that use it (`PMOMusic`, `pmoaudiocache`, `pmocache`, `pmocontrol`, `pmocovers`, `pmodidl`, `pmoparadise`, `pmoplaylist`, `pmoqobuz`, `pmoserver`, `pmosound-api`, `pmosource`, `pmoupnp`).
- Update `utoipa-swagger-ui` to v10.0 in `pmoserver`.
- Replace `serde_yaml::Value`, `serde_yaml::Number`, and `serde_yaml::Mapping` imports with their `serde_yaml_ng` equivalents in all source files (e.g., `config_ext.rs`, `config.rs`, `services.rs`).
- Adjust configuration setter logic to use `serde_yaml_ng::Number::from` where appropriate (e.g., `pmobbc`, `pmocache`, `pmoident`, `pmomultiroom`, `pmoqobuz`, `pmoradiofrance`, `pmoreaders`).
- Update test assertions and YAML loading functions to use `serde_yaml_ng` types.
- Remove obsolete documentation regarding `utoipa` 5→6 migration from `TODO.md`.
Update `pmoconfig` to 0.2.0 and `windows-sys` to 0.48.0 in Cargo.toml and Cargo.lock. Enhance `.crate-kit/crate.mk` to use `--all-features` for tests and docs, add `DEPS_CHECK_EXTERNAL_IGNORE` support in `deps-check-external.sh`, and improve `jjfetch.sh` logic for handling divergent revisions.

- Update `pmoconfig` dependency from 0.1.1 to 0.2.0 in Cargo.toml and Cargo.lock
- Update `windows-sys` dependency from 0.61.2 to 0.48.0 in Cargo.lock
- Add `--all-features` flag to debug, test-doc, doc, and doc-build commands in .crate-kit/crate.mk
- Add support for DEPS_CHECK_EXTERNAL_IGNORE variable in .crate-kit/scripts/deps-check-external.sh
- Improve jjfetch.sh logic to handle divergent revisions and twin changes
- Update version from 0.1.8 to 0.1.12 in .crate-kit/VERSION
- Add documentation and help synchronization logic to .crate-kit/jj.mk
Refactor configuration handling to use `Arc<Config>` for shared access, removing the explicit `credentials` field from `QobuzClient` in favor of retrieving them via `config.get_qobuz_credentials()`. Update cache TTL mechanisms to use dynamic function calls (`self.ttl()`) instead of static fields.

- Modify `QobuzApi` and `QobuzClient` to remove `format_id` and `credentials` fields, replacing them with shared config access.
- Update `get_file_url` in `catalog.rs` to accept an `AudioFormat` argument directly, removing the need for a stored format ID.
- Change cache TTL logic across `catalog`, `ephemeral`, `object_meta`, and `mod` files to use `self.ttl()` accessor instead of direct field access.
- Replace `set_format` and `set_page_concurrency` with dynamic configuration retrieval from `Arc<Config>` in client methods like `get_stream_url` and `get_playlist_tracks`.
- Update `QobuzCache::open` to `open_live` and modify `with_config` to accept `Arc<Config>`, constructing a TTL function based on config values.
- Refactor authentication logic in `auth.rs` and `favorites/sync.rs` to fetch credentials from `config.get_qobuz_credentials()` instead of storing them in the client.
- Update example files `refresh_track_identifiers.rs` and `test_getfileurl.rs` to pass `Arc<Config>` and explicit `AudioFormat` arguments respectively.
- Adjust test suites in `tests.rs`, `config_page.rs`, and `pmouniverse-identify/src/main.rs` to use `Arc::new(config)` and reflect the new shared state behavior.
Remove the `pmoserver/src/config_ext.rs` module and its associated `ConfigExt` trait, which previously exposed configuration API endpoints. Update `pmoconfig` dependency to disable the `api` feature, keeping only `webui`.

- Delete `pmoserver/src/config_ext.rs`, removing `init_config_api` and the `ConfigExt` implementation for `Server`.
- Remove `pub mod config_ext` and `pub use config_ext::ConfigExt` from `pmoserver/src/lib.rs`.
- Update `pmoserver/Cargo.toml` to reduce `pmoconfig` features from `["api", "webui"]` to `["webui"]`.
- Modify `PMOMusic/src/bootstrap.rs` to use `std::sync::OnceLock` in `validate_declared_keys` for single-run validation and update comments to reflect modifiable configuration pages.
- Update test `a_fresh_configuration_satisfies_every_declared_key` in `PMOMusic/src/tests/bootstrap.rs` to expect 14 declared keys instead of 13.
Implement a three-tier authentication fallback mechanism in QobuzClient,
prioritizing token checks, config credentials, and Spoofer fallback. Add
a new "test_login" action to the configuration page for verifying credentials
and include corresponding integration tests.

- Add `api_from_config` and `check_credentials` to handle API creation with
  a three-tier fallback (memorized secret, XOR secret, Spoofer) and retry
  logic on authentication failure.
- Update `from_config_obj` in `construct.rs` to delegate to the new API
  creation logic and update documentation for the initialization priority.
- Add "test_login" action to `qobuz_config_page` in `config_page.rs` to
  verify credentials without affecting the session, clarifying audio quality
  help text.
- Add `the_page_offers_a_login_test_that_needs_credentials` test in
  `tests/config_page.rs` to assert login failure messages when credentials
  are invalid.
Move device-related test functions from `pmomusic-config/src/devices.rs` to new test modules in `pmomusic-config/src/tests/`. Add a new `devices_page.rs` module to manage device retention settings. Update bootstrap logic to include the new devices configuration page.

- Move device tests (`config`, UDN generation/migration, purging logic, retention defaults) from `pmomusic-config/src/devices.rs` to `pmomusic-config/src/tests/devices.rs`.
- Move device page test config from `pmomusic-config/src/devices.rs` to `pmomusic-config/src/tests/devices_page.rs`.
- Add `pmomusic-config/src/devices_page.rs` defining the "Devices" configuration page with retention settings (`DEVICE_RETENTION_DAYS`) and read-only device list management.
- Move general PMOMusic tests (`pmomusic_keeps_its_historical_names`, etc.) from `pmomusic-config/src/lib.rs` to `pmomusic-config/src/tests/lib.rs`.
- Add `pmomusic-config/src/tests/mod.rs` to export new test modules: `devices`, `devices_page`, and `lib`.
- Update `PMOMusic/src/bootstrap.rs` to include `pmomusic_config::devices_config_page()` in configuration setup.
- Update `PMOMusic/src/tests/bootstrap.rs` to expect 15 declared keys instead of 14.
Refactor configuration handling to move `http_port` from the `host` section to a new `upnp` section, ensuring that server URLs are strictly validated at startup. Update internal APIs to return `Result` types for ports and URLs, propagating errors rather than silently failing or panicking unexpectedly.

- Move `http_port` from `host` to `upnp` in `pmomusic.yaml` and `pmosound.yaml`, adding `manufacturer` and `model_name_prefix` to the new section.
- Add `server_config_page` to `pmoserver/src/config_page.rs` to configure HTTP port, base URL, external URL, and WAN port with restart requirements.
- Update `HostConfigExt` in `pmoserver/src/host_config.rs` to return `Result` for `get_http_port`, `get_base_url`, and `get_external_url`, adding a `port` helper and new configuration keys.
- Modify `start_wan_listener` in `pmoauth/src/server_ext.rs` to handle `Result` returns from `get_external_url` and `get_wan_port`, returning errors for missing external URLs when SSO is enabled.
- Update `api_from_config` in `pmoqobuz/src/client/construct.rs` to use a direct match expression for determining the API, prioritizing memorized Spoofer secrets.
- Enforce configuration validation in `pmoserver/src/server.rs` by panicking if `get_base_url()` or `get_http_port()` returns an error during server construction.
- Update `new_configured` and related methods in `pmoserver/src/server.rs` to chain `.await` calls for route mounting and handle errors explicitly.
- Modify `own_origins` and `is_own_url_among` in `pmoserver/src/rebase.rs` to conditionally push external URLs only if retrieval succeeds, using `origin_of` checks.
- Update `wan_rewrite.rs` and `wan.rs` in `pmoserver` to use explicit `State` for middleware and handle `Result` returns from body extraction methods.
- Adjust `device_instance.rs` in `pmoupnp` to panic on invalid HTTP port configuration, ensuring the server base URL is constructed correctly.
- Update health checks in `PMOMusic/src/healthcheck.rs` to retrieve HTTP port from configuration with error handling and use `tokio::time::timeout` for probing.
- Modify `declared_keys` and `create_upnp_server` in `PMOMusic/src/bootstrap.rs` to include `pmoserver::SERVER_KEYS` and new server configuration pages.
- Update tests in `pmomusic-config`, `pmosound`, and `pmoserver` to reflect the removal of `http_port` from `host` and the addition of `upnp` section validation.
Update documentation to reflect that an invalid external URL no longer prevents startup but instead closes the WAN port for the session while leaving the local port open. This change aligns the help text, function comments, and test cases with the actual error handling logic where PMOMusic logs the error at startup.

- Update `EXTERNAL_URL` help text in `config_page.rs` to describe WAN port closure instead of startup prevention
- Revise `get_external_url` documentation in `host_config.rs` to indicate caller decision on startup errors
- Adjust test case comments in `tests/host_config.rs` to match the new WAN shutdown behavior
Add the `tokio-util` dependency and implement an in-process restart mechanism for PMOMusic. This allows the server to cleanly stop and relaunch itself without relying on external process supervisors, improving resilience during configuration changes or updates.

- Add `tokio-util` as a workspace dependency in `PMOMusic/Cargo.toml`.
- Implement `PMOMusic/src/restart.rs` with `request`, `requested`, `exec_self`, and `program_path` to handle self-replacement via `exec` on Unix.
- Update `PMOMusic/src/main.rs` to check for restart requests and execute `restart::exec_self()` if triggered, ensuring background threads are carried over.
- Modify `PMOMusic/src/bootstrap.rs` to add a restart hook that warns users about stream interruption during server unavailability.
- Refactor `PMOMusic/src/control_bridge.rs`: update `attach`, `follow_transport`, and `push_renderer` signatures and logic for better event handling and URL construction.
- Update `PMOMusic/src/healthcheck.rs` probe function error handling to explicitly return invalid data errors.
- Modify `pmoserver/src/server.rs` `spawn_listener` to handle graceful shutdown signals and enforce timeouts for forced HTTP server shutdowns.
- Add tests in `PMOMusic/src/tests/restart.rs` to verify path resolution and restart request state management.
- Update `Readme.md` to document the new "Restart" function, WAN port authentication behavior based on `sso_enabled`, and configuration editing rules.
Introduce a `host.wan_expose_config` boolean setting to control whether the
configuration editor is accessible on the WAN port. Update documentation,
server logic, and tests to reflect this new security boundary. Refactor WAN
test code into a dedicated module for better organization.

- Add `WAN_EXPOSE_CONFIG` key to host configuration and implement `get_wan_expose_config` in `HostConfigExt`.
- Update `pmoserver/src/wan.rs` to conditionally block `/config` on the WAN port based on the new setting, moving test helpers to `pmoserver/src/tests/wan.rs`.
- Modify `pmoauth` bearer token extraction and route checks to use explicit error types and chained calls.
- Update `pmoauth` server middleware to pass `require_session` state and adjust log messages for WAN port authentication status.
- Adjust configuration test assertions in `PMOMusic/src/tests/bootstrap.rs` to expect 20 declared keys.
- Update `Readme.md` to document the new `host.wan_expose_config` setting and its effect on WAN port access.
- Update "Redémarrer" section to clarify that settings marked "redémarrage requis" are now read at startup.
- Document the new "Enregistrer et redémarrer" button which saves and restarts without confirmation, preventing restart if saving fails.
- Describe the "Redémarrer le serveur" button that shows a confirmation page and handles clean server restart within the same process.
Migrate configuration key declarations from a central `pmocache` module to individual crates (`pmoaudiocache`, `pmoupnp`) using dedicated config pages. This involves replacing legacy `Setting::legacy` patterns with explicit `Key` constants, `Result`-returning accessors, and validation pages that enforce restart requirements.

- Remove `pmocache/src/config_ext.rs` and its `CacheConfigExt` trait, moving audio cache key definitions (`AUDIO_CACHE_DIR`, `AUDIO_CACHE_SIZE`) to `pmoaudiocache`.
- Add `pmoaudiocache/src/config_page.rs` with `audio_cache_config_page` for validating cache settings, requiring restarts for directory and size changes.
- Migrate UPnP configuration keys (`UPNP_MANUFACTURER`, prefixes, suffix) from `pmoupnp` to `pmoupnp/src/config_page.rs` with a new `upnp_config_page`.
- Update `pmoaudiocache` and `pmoupnp` lib files to export their respective config pages and traits, integrating them into the application bootstrap.
- Refactor `pmomusic` bootstrap to use `.with(pmoaudiocache::AUDIO_KEYS)` and `.with(pmoupnp::upnp_config_page())` for key registration.
- Update `pmomusic-config` tests to reflect that default YAML declares no host sections, removing legacy expectation tests.
- Add `DeviceError::Config` variant in `pmoupnp` to handle configuration errors from `pmoconfig`.
- Update `register_device` and `start_upnp` to propagate configuration errors using `?` instead of unwrapping or ignoring them.
- Move device name generation tests (`friendly_name_from_config_has_prefix_and_name`, `named_from_config_starts_with_the_name`) from `device.rs` to `pmoupnp/src/devices/tests/device.rs`.
Refactor the codebase to replace hardcoded string IDs with a centralized `SourceKeys` enum/type for all sources. Move `id` and `name` implementations from individual provider crates into `pmoliveradio/src/provider.rs`. Relocate source configuration extension traits (`SourcesConfigExt`) and helper functions from `pmosource/src/config_ext.rs` to the new `pmosource/src/source_keys.rs`.

- Centralize source identification by moving `id` and `name` implementations from `pmobbc`, `pmokexp`, `pmoliveradio`, `pmonova`, `pmoradiofrance`, `pmorai`, `pmortbf`, `pmorts`, and `pmowfmu` into `pmoliveradio/src/provider.rs`.
- Introduce `SourceKeys` struct and `SourcesConfigExt` trait in `pmosource/src/source_keys.rs`, replacing the previous definitions in `pmosource/src/config_ext.rs`.
- Update all source implementations (e.g., `pmoparadise`, `pmoqobuz`, `pmoreaders`, `pmourlsource`, `pmoyoutube`) to use `SOURCE_KEYS` constants for `id`, `name`, and configuration checks.
- Modify `pmomediaserver` to use `config_keys()` for determining source visibility and folder paths, replacing direct string comparisons in `visible_sources` and registration functions.
- Add `source_keys()` and `source_pages()` functions in `pmomediaserver/src/source_config.rs` to aggregate configuration pages and keys based on enabled features.
- Update `PMOMusic` bootstrap logic to use `declared_pages()` and `declared_keys()` for aggregating configuration from various crates.
- Adjust error handling in `pmomediaserver` to return `Result<bool>` for `is_source_disabled`, wrapping configuration errors appropriately.
Refactor all source modules to replace raw string keys with typed `Key` constants, enforcing validation at read time. Introduce dedicated `config_page` modules for each source (BBC, RadioFrance, Readers, Universe, YouTube) to expose settings in the UI. Update bootstrap logic to aggregate these new keys and pages.

- Move configuration test functions from `pmoident/src/config.rs` to specific test files in `pmobbc`, `pmoident`, `pmomusic-config`, `pmoradiofrance`, and `pmoreaders`.
- Replace raw string keys with typed constants (e.g., `BBC_STATION_CACHE_TTL`, `UNIVERSE_THREADS`) in `pmobbc`, `pmoradiofrance`, `pmouniverse`, `pmoyoutube`, and `pmoreaders`.
- Add `config_page` modules to all source crates, exposing settings like BBC station TTL, RadioFrance mapping TTL, Readers silence thresholds, Universe thread counts, and YouTube paths.
- Update `BrowseConfigExt` in `pmosource` to return `Result` types for deadlines and min items, handling potential configuration errors gracefully.
- Modify `UniverseConfigExt` and `YoutubeConfigExt` to enforce constraints (e.g., minimum values) and handle missing or invalid configuration data without panicking.
- Update `pmomusic-config` storage logic to use managed directories and add a dedicated page for SQLite database location settings.
- Change `register_youtube` in `pmomediaserver` to log system `yt-dlp` presence instead of writing it to configuration.
- Add `declared_source_keys` function to aggregate keys from all sources, updating bootstrap and media server initialization logic.
Refactor `pmoyoutube` to explicitly track how the `yt-dlp` binary was obtained (Configured, SystemPath, or Managed) using a new `in_use` module. This information is now exposed via an `Info` page in the configuration UI, replacing the previous registration mechanism.

- Add `pmoyoutube/src/in_use.rs` with `YtDlpOrigin` enum and functions to record/retrieve the active yt-dlp instance
- Update `register_youtube` in `sources.rs` to determine binary origin and call `record_yt_dlp_in_use`
- Modify `youtube_config_page` to display an `Info` page showing the retained `yt-dlp` program and its source
- Add tests in `tests/in_use.rs` verifying that the config page correctly displays yt-dlp status without writing to file
Move PMO Sound configuration logic into a new `pmosound-config` crate to decouple it from the main application binary. Update `AppSpec` initialization across the codebase to remove the default YAML argument, enforcing that each crate declares its own keys and defaults.

- Move `SoundConfigExt`, `spec`, and related constants from `pmosound/src/config_ext.rs` to `pmosound-config`.
- Add `pmosound-config` crate with `config_ext.rs`, `config_page.rs`, and `in_use.rs` for sound settings and ALSA card tracking.
- Delete `pmosound/src/pmosound.yaml` and `pmomusic-config/src/pmomusic.yaml` as defaults are now declared in code.
- Update `AppSpec::new` calls in tests across `pmomusic-config`, `pmoreaders`, `pmoyoutube`, etc., to remove the empty string default YAML argument.
- Add SSO configuration page and tests in `pmoauth` with read-only OIDC settings and provider validation.
- Remove `pmoparadise/src/config_ext.rs` as its configuration is handled by `pmosource`.
feat: refactor multiroom and sound configuration with new pages and validation
All checks were successful
Release / create-release (push) Successful in 12s
Release / apk (push) Successful in 4m24s
f67871d26d
Introduce dedicated configuration pages for `pmomultiroom` and `pmosound`, moving logic from main files to modular structures. Add comprehensive validation checks for multiroom groups, silence detection, and ALSA timing constraints. Update dependencies and snapshot scripts to support the new configuration schema and API documentation format.

- Refactor `pmomultiroom`: move `clock_name`, `learned_entry`, and `parse_learned` from `config.rs` to new `learned.rs`; add `multiroom_config_page` in `config_page.rs` with group/destination tables; add `keys.rs` for constants.
- Refactor `pmosound`: move `declared_keys` from `main.rs` to new `config_pages.rs`; add `config_pages()` and `declared_keys()` functions; update `start_upnp` to initialize web UI router with these pages.
- Add validation checks: `ident_config_page` prevents inconsistent timing settings; `sound_config_page` ensures ALSA period is shorter than buffer; `multiroom_config_page` validates group/destination consistency.
- Update `pmomusic-config`: add `devices_page` wildcards and UDN/last_seen fields; update `storage_config_page` to show resolved directory as read-only info; remove `storage_config_page` from `PMOMusic`.
- Add `pmoreaders` silence detection: new "Détection de silences par lecteur" collection with threshold/hysteresis/min_silence_ms/min_sound_ms fields; add `known.rs` for static reader registry.
- Update `.crate-kit`: change API snapshot to `.json.gz`; update `api-level.sh` and `latest_snapshot` for gzipped files; bump version to 0.1.13.
- Update dependencies: `pmoconfig` to 0.3, `windows-sys` to 0.59.0, `socket2` to 0.5.10; add `serde_json` and `alac-encoder` to `pmosound`.
eric merged commit 01ae2e1c82 into main 2026-11-11 13:21:44 +01:00
eric deleted branch push-yynluqyruopn 2026-11-11 13:21:53 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pmo/pmomusic!176
No description provided.