Skip to content

add Yandex Disk provider#4828

Draft
trudenboy wants to merge 2 commits into
music-assistant:devfrom
trudenboy:upstream/filesystem_yandex_disk
Draft

add Yandex Disk provider#4828
trudenboy wants to merge 2 commits into
music-assistant:devfrom
trudenboy:upstream/filesystem_yandex_disk

Conversation

@trudenboy

@trudenboy trudenboy commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What does this implement/fix?

Adds a new Yandex Disk music provider (filesystem_yandex_disk) that streams music, audiobooks and podcasts stored on a user's Yandex Disk.

Source: trudenboy/ma-provider-yandex-disk · tag v0.1.0 · documentation

Highlights

  • Browse and stream audio files from a configured Yandex Disk folder, with library sync (tracks / albums / artists / playlists) and seek support.
  • Read-only OAuth authentication (cloud_api:disk.read scope) with automatic token refresh. Uses the user's own Yandex OAuth application via Yandex's confirmation-code flow — the user pastes the code Yandex shows, no redirect URI to register.
  • Architecture mirrors the existing Google Drive provider; the Yandex Disk REST API is accessed through the yadisk library (yadisk==3.4.1).
  • Supports multiple instances (e.g. different accounts or folders).
  • Test suite included under tests/providers/filesystem_yandex_disk/ (API client, auth, config flow, provider, integration) with JSON fixtures.

Related issue (if applicable):

  • N/A

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.

@codspeed-hq

codspeed-hq Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 11 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing trudenboy:upstream/filesystem_yandex_disk (65be45d) with dev (7257caf)2

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on dev (294f1c0) during the generation of this report, so 7257caf was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@trudenboy trudenboy changed the title feat(filesystem_yandex_disk): add filesystem_yandex_disk provider v0.1.0 feat(filesystem_yandex_disk): add Yandex Disk provider Jul 16, 2026
@trudenboy
trudenboy marked this pull request as ready for review July 16, 2026 21:35
@trudenboy trudenboy changed the title feat(filesystem_yandex_disk): add Yandex Disk provider add Yandex Disk provider Jul 16, 2026
@OzGav

OzGav commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tests are failing and the checklist item for documentation is not there but that needs to be done.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new cloud filesystem music provider (filesystem_yandex_disk) that integrates Yandex Disk into Music Assistant via the existing CloudFileSystemProvider abstraction (browse/sync/stream via MA proxy), including OAuth-based authentication and a yadisk-backed async API client.

Changes:

  • Added filesystem_yandex_disk provider implementation (provider wiring, OAuth helper, yadisk API wrapper, manifest/icons/version, strings).
  • Added a dedicated test suite under tests/providers/filesystem_yandex_disk/ with fixtures and integration coverage of CloudFileSystemProvider._scandir.
  • Added yadisk==3.4.1 to requirements_all.txt and added provider translation strings.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/providers/filesystem_yandex_disk/test_provider.py Unit tests for provider hook delegation.
tests/providers/filesystem_yandex_disk/test_integration.py Integration coverage for _scandir mapping and stream URL generation.
tests/providers/filesystem_yandex_disk/test_config_flow.py Config-flow tests for OAuth fields and reconfigure behavior.
tests/providers/filesystem_yandex_disk/test_auth.py OAuth code/refresh flow tests.
tests/providers/filesystem_yandex_disk/test_api_client.py API client mapping/token handling tests.
tests/providers/filesystem_yandex_disk/fixtures/listdir_music.json Listing fixture used by integration test.
tests/providers/filesystem_yandex_disk/conftest.py Optional working-tree provider aliasing for upstream/provider-repo layouts.
tests/providers/filesystem_yandex_disk/init.py Test package marker.
requirements_all.txt Adds yadisk==3.4.1.
music_assistant/translations/en.json Adds Yandex Disk provider UI strings.
music_assistant/providers/filesystem_yandex_disk/VERSION Provider version.
music_assistant/providers/filesystem_yandex_disk/strings.json Provider strings source for translation generation.
music_assistant/providers/filesystem_yandex_disk/provider.py Provider wiring and CloudFileSystemProvider hook implementations.
music_assistant/providers/filesystem_yandex_disk/manifest.json Provider manifest and requirements.
music_assistant/providers/filesystem_yandex_disk/icon.svg Provider icon.
music_assistant/providers/filesystem_yandex_disk/icon_monochrome.svg Monochrome icon variant.
music_assistant/providers/filesystem_yandex_disk/constants.py Provider constants and OAuth endpoints.
music_assistant/providers/filesystem_yandex_disk/auth.py OAuth “manual code” flow and refresh-token handling.
music_assistant/providers/filesystem_yandex_disk/api_client.py yadisk-based async API wrapper used by provider hooks.
music_assistant/providers/filesystem_yandex_disk/init.py Provider setup and config-entry flow (including auth action).

Comment on lines +156 to +160
if client_secret == SECURE_STRING_SUBSTITUTE and instance_id:
client_secret = str(
mass.config.get_raw_provider_config_value(instance_id, CONF_CLIENT_SECRET) or ""
)
if not client_id or not client_secret:
Comment on lines +42 to +48
params = {
"response_type": "code",
"client_id": client_id,
"scope": OAUTH_SCOPE,
"force_confirm": "yes",
}
return f"{OAUTH_AUTHORIZE_URL}?{urlencode(params)}"
Comment on lines +62 to +69
def test_manual_authorize_url_contains_client_and_scope() -> None:
"""The manual authorize URL carries the client id and read scope."""
url = auth.manual_authorize_url("cid123")
assert url.startswith(OAUTH_AUTHORIZE_URL)
assert "client_id=cid123" in url
assert "response_type=code" in url
assert "cloud_api" in url

@MarvinSchenkel

Copy link
Copy Markdown
Contributor

Please have a look at the copilot comments. Marking this PR as draft so we can keep track of which PRs needs our attention. Please mark as 'Ready for review' when you want us to have another look 🙏 .

@MarvinSchenkel
MarvinSchenkel marked this pull request as draft July 20, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants