quintodrome/core
Deluan Quintão 9dbe0c183e
feat(insights): add plugin and multi-library information (#4391)
* feat(plugins): add PluginList method

Signed-off-by: Deluan <deluan@navidrome.org>

* feat: enhance insights collection with plugin awareness and expanded metrics

Enhanced the insights collection system to provide more comprehensive telemetry data about Navidrome installations. This update adds plugin awareness through dependency injection integration, expands configuration detection capabilities, and includes additional library metrics.

Key improvements include:
- Added PluginLoader interface integration to collect plugin information when enabled
- Enhanced configuration detection with proper credential validation for LastFM, Spotify, and Deezer
- Added new library metrics including Libraries count and smart playlist detection
- Expanded configuration insights with reverse proxy, custom PID, and custom tags detection
- Updated Wire dependency injection to support the new plugin loader requirement
- Added corresponding data structures for plugin information collection

This enhancement provides valuable insights into feature usage patterns and plugin adoption while maintaining privacy and following existing telemetry practices.

* fix: correct type assertion in plugin manager test

Fixed type mismatch in test where PluginManifestCapabilitiesElem was being
compared with string literal. The test now properly casts the string to the
correct enum type for comparison.

* refactor: move static config checks to staticData function

Moved HasCustomTags, ReverseProxyConfigured, and HasCustomPID configuration checks from the dynamic collect() function to the static staticData() function where they belong. This eliminates redundant computation on every insights collection cycle and implements the actual logic for HasCustomTags instead of the hardcoded false value.

The HasCustomTags field now properly detects if custom tags are configured by checking the length of conf.Server.Tags. This change improves performance by computing static configuration values only once rather than on every insights collection.

* feat: add granular control for insights collection

Added DevEnablePluginsInsights configuration option to allow fine-grained control over whether plugin information is collected as part of the insights data. This change enhances privacy controls by allowing users to opt-out of plugin reporting while still participating in general insights collection.

The implementation includes:
- New configuration option DevEnablePluginsInsights with default value true
- Gated plugin collection in insights.go based on both plugin enablement and permission flag
- Enhanced plugin information to include version data alongside name
- Improved code organization with clearer conditional logic for data collection

* refactor: rename PluginNames parameter from serviceName to capability

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-28 13:21:10 -04:00
..
agents feat(insights): add plugin and multi-library information (#4391) 2025-07-28 13:21:10 -04:00
artwork feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
auth feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
external fix(server): ensure that similar artists retrieved from provider are no more than limit (#4267) 2025-06-29 12:19:29 -04:00
ffmpeg fix(server): better embedded artwork extraction with ffmpeg (#3860) 2025-03-20 19:26:40 -04:00
lyrics feat:(server): support reading lyrics from filesystem (#2897) 2025-04-30 08:10:19 -04:00
metrics feat(insights): add plugin and multi-library information (#4391) 2025-07-28 13:21:10 -04:00
playback test: fix mpv tests on systems without /bin/bash installed - 4301 (#4302) 2025-07-02 21:55:55 -04:00
scrobbler feat(insights): add plugin and multi-library information (#4391) 2025-07-28 13:21:10 -04:00
storage fix: improve URL path handling in local storage for special characters (#4378) 2025-07-23 20:46:47 -04:00
archiver.go feat(server): add M3U file to downloaded playlist 2025-05-27 20:13:37 -04:00
archiver_test.go feat(server): add M3U file to downloaded playlist 2025-05-27 20:13:37 -04:00
common.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
common_test.go test: add tests for userName and AbsolutePath in core/common.go 2025-04-18 11:53:47 -04:00
core_suite_test.go Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
inspect.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
library.go feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
library_test.go feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
media_streamer.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
media_streamer_Internal_test.go fix: forcing transcoding when client does not specify transcoding options (#3455) 2024-11-05 20:39:05 -05:00
media_streamer_test.go Add support for timeOffset in /stream endpoint 2023-12-02 13:10:36 -05:00
mock_library_service.go feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
players.go feat(server): group Subsonic config options together 2025-03-05 12:29:30 -08:00
players_test.go Use userId in player, other fixes (#3182) 2024-08-03 13:37:21 -04:00
playlists.go fix(scanner): Apple Music playlists import for songs with accented characters (#4385) 2025-07-26 11:27:35 -04:00
playlists_test.go fix(scanner): Apple Music playlists import for songs with accented characters (#4385) 2025-07-26 11:27:35 -04:00
share.go fix(server): headless library access improvements (#4362) 2025-07-20 15:58:21 -04:00
share_test.go Add option to allow share to be downloaded 2023-03-10 23:33:29 -05:00
wire_providers.go feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00