Skip to content

Address review comments: simplify Yandex Music provider configuration#41

Merged
trudenboy merged 3 commits intorefactor/yandex-config-categoriesfrom
copilot/fix-documentation-url-requirements
Feb 16, 2026
Merged

Address review comments: simplify Yandex Music provider configuration#41
trudenboy merged 3 commits intorefactor/yandex-config-categoriesfrom
copilot/fix-documentation-url-requirements

Conversation

Copy link

Copilot AI commented Feb 16, 2026

Addresses review feedback on PR music-assistant#3147 to reduce configuration complexity and follow logging conventions.

Changes

Configuration simplification

  • Reduced from 25+ config entries to 8 essential ones
  • Removed all feature toggle configs (recommendations, browse sections, playlists) - now always enabled with sane defaults
  • Removed performance tuning configs - hardcoded as constants:
    • MY_WAVE_BATCH_SIZE = 3
    • TRACK_BATCH_SIZE = 50
    • DISCOVERY_INITIAL_TRACKS = 5
    • BROWSE_INITIAL_TRACKS = 15
  • Kept only: authentication, quality, streaming mode, max tracks limits, and base URL
  • Removed category attributes from remaining entries (unnecessary with 8 entries)

Dependency management

  • Moved pycryptodome==3.23.0 from global pyproject.toml to provider's manifest.json
  • Fixed documentation URL from beta to production domain

Logging format

  • Replaced f-string logging with %s formatting (17 instances):
    # Before
    self.logger.debug(f"Got {len(tracks)} tracks")
    
    # After
    self.logger.debug("Got %s tracks", len(tracks))

Net impact: -304 lines of code

Original prompt

Summary

Address all review comments from @MarvinSchenkel on PR music-assistant#3147.

Changes Required

1. Fix documentation URL in manifest.json

File: music_assistant/providers/yandex_music/manifest.json

Change "documentation": "https://beta.music-assistant.io/music-providers/yandex-music/" back to "documentation": "https://music-assistant.io/music-providers/yandex-music/".

Also add pycryptodome==3.23.0 to the requirements array in the same file (see step 2).

The result should be:

{
  "type": "music",
  "domain": "yandex_music",
  "stage": "beta",
  "name": "Yandex Music",
  "description": "Stream music from Yandex Music service.",
  "codeowners": ["@TrudenBoy"],
  "documentation": "https://music-assistant.io/music-providers/yandex-music/",
  "requirements": ["yandex-music==2.2.0", "pycryptodome==3.23.0"],
  "multi_instance": true
}

2. Move pycryptodome dependency from pyproject.toml to provider's manifest.json

File: pyproject.toml

Remove the line "pycryptodome==3.23.0", from the global dependencies list in pyproject.toml. Provider-specific dependencies belong in the provider's manifest.json requirements array (done in step 1).

3. Drastically reduce the number of ConfigEntry — keep only essential ones

Review comment: "Why do we need all these ConfigEntries? I think we can just pick some sane values that work for the users instead of exposing 25+ config entries?"

File: music_assistant/providers/yandex_music/__init__.py

Keep the following ConfigEntry items (total ~8):

  • CONF_TOKEN — authentication (required)
  • CONF_ACTION_CLEAR_AUTH — reset authentication action
  • CONF_QUALITY — audio quality selection (user-facing)
  • CONF_STREAMING_MODE — FLAC streaming mode (advanced)
  • CONF_PRELOAD_BUFFER_MB — preload max file size (advanced, depends_on streaming mode)
  • CONF_MY_WAVE_MAX_TRACKS — My Wave maximum tracks (advanced)
  • CONF_LIKED_TRACKS_MAX_TRACKS — Liked Tracks maximum tracks (advanced)
  • CONF_BASE_URL — API Base URL (advanced)

Remove ALL other ConfigEntry items and hardcode their sane default values as constants. Specifically, remove these config entries from get_config_entries() and hardcode them:

  • CONF_ENABLE_RECOMMENDATIONS → hardcode True
  • CONF_ENABLE_MY_WAVE_BROWSE → hardcode True
  • CONF_ENABLE_MY_WAVE_PLAYLIST → hardcode True
  • CONF_ENABLE_MY_WAVE_RADIO → hardcode True
  • CONF_MY_WAVE_BATCH_SIZE → hardcode 3
  • CONF_ENABLE_LIKED_TRACKS_BROWSE → hardcode True
  • CONF_ENABLE_LIKED_TRACKS_PLAYLIST → hardcode True
  • CONF_ENABLE_FEED_RECOMMENDATIONS → hardcode True
  • CONF_ENABLE_CHART → hardcode True
  • CONF_ENABLE_NEW_RELEASES → hardcode True
  • CONF_ENABLE_NEW_PLAYLISTS → hardcode True
  • CONF_ENABLE_PICKS_BROWSE → hardcode True
  • CONF_ENABLE_MIXES_BROWSE → hardcode True
  • CONF_ENABLE_TOP_PICKS → hardcode True
  • CONF_ENABLE_MOOD_MIXES → hardcode True
  • CONF_ENABLE_ACTIVITY_MIXES → hardcode True
  • CONF_ENABLE_SEASONAL_MIXES → hardcode True
  • CONF_TRACK_BATCH_SIZE → hardcode 50
  • CONF_DISCOVERY_INITIAL_TRACKS → hardcode 5
  • CONF_BROWSE_INITIAL_TRACKS → hardcode 15

In constants.py: For the removed config keys, keep only the default value constants (e.g., MY_WAVE_BATCH_SIZE = 3, TRACK_BATCH_SIZE = 50, etc.) and remove the CONF_* key strings that are no longer needed.

In provider.py: Replace all self.config.get_value(CONF_REMOVED_KEY) calls with the hardcoded constant values. For example:

  • self.config.get_value(CONF_ENABLE_RECOMMENDATIONS, True) → just True (remove the if-check or always execute the block)
  • self.config.get_value(CONF_MY_WAVE_BATCH_SIZE) or 3MY_WAVE_BATCH_SIZE (a constant = 3)
  • self.config.get_value(CONF_TRACK_BATCH_SIZE) or 50TRACK_BATCH_SIZE (a constant = 50)
  • etc.

For the kept config entries (CONF_MY_WAVE_MAX_TRACKS, CONF_LIKED_TRACKS_MAX_TRACKS, CONF_BASE_URL), keep using self.config.get_value(...).

In __init__.py setup(): Remove the conditional check if not config.get_value(CONF_ENABLE_RECOMMENDATIONS, True) since recommendations are now always enabled.

Remove category attributes from the remaining ConfigEntry items since there will be so few entries that categories are unnecessary. The remaining advanced entries should just use advanced=True without category=.

4. Replace ALL f-string logging with %s formatting

Review comment: "Use %s formatting when logging. There's quite a few more of these in this PR. Always use %s over f-string logging."

Search ALL files in music_assistant/providers/yandex_music/ for patterns like:

  • self.logger.debug(f"...")
  • self.logger.info(f"...")
  • self.logger.warning(f"...")
  • self.logger.error(f"...")

And replace them ALL with %s-style formatting.

Known locations in provider.py:

  • Line 815: `self.logger.debug(f"_get_like...

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 16, 2026 08:34
Co-authored-by: trudenboy <139659391+trudenboy@users.noreply.github.com>
- Keep only 8 essential config entries: token, clear auth, quality, streaming mode, preload buffer, My Wave max tracks, Liked Tracks max tracks, and base URL
- Remove 20+ config entries and hardcode sane defaults
- Remove all category attributes from config entries
- Remove conditional recommendation check in setup()
- Replace all f-string logging with %s formatting (17 instances)
- Update constants.py to keep only necessary constants

Co-authored-by: trudenboy <139659391+trudenboy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix documentation URL and update requirements in manifest.json Address review comments: simplify Yandex Music provider configuration Feb 16, 2026
Copilot AI requested a review from trudenboy February 16, 2026 08:43
@trudenboy trudenboy marked this pull request as ready for review February 16, 2026 08:46
@trudenboy trudenboy merged commit b6cc561 into refactor/yandex-config-categories Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants