add Yandex Disk provider#4828
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
Tests are failing and the checklist item for documentation is not there but that needs to be done. |
There was a problem hiding this comment.
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_diskprovider 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 ofCloudFileSystemProvider._scandir. - Added
yadisk==3.4.1torequirements_all.txtand 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). |
| 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: |
| params = { | ||
| "response_type": "code", | ||
| "client_id": client_id, | ||
| "scope": OAUTH_SCOPE, | ||
| "force_confirm": "yes", | ||
| } | ||
| return f"{OAUTH_AUTHORIZE_URL}?{urlencode(params)}" |
| 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 | ||
|
|
|
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 🙏 . |
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
cloud_api:disk.readscope) 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.yadisk==3.4.1).tests/providers/filesystem_yandex_disk/(API client, auth, config flow, provider, integration) with JSON fixtures.Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.