fix(yandex_music): fix playlist loading and missing album cover art (#3099)
authorMikhail Nevskiy <139659391+trudenboy@users.noreply.github.com>
Mon, 9 Feb 2026 08:42:59 +0000 (11:42 +0300)
committerGitHub <noreply@github.com>
Mon, 9 Feb 2026 08:42:59 +0000 (09:42 +0100)
commit710d84e9e18ad4f7a1386c93311add687c4caa61
treec044bd197cc5f4095cf2bf377ef9fe57f06e5ce7
parenta6290c3253ee3db0333df73363516b9dea8d0e2e
fix(yandex_music): fix playlist loading and missing album cover art (#3099)

* fix(yandex_music): fix playlist tracks not loading in UI

- Return empty list for page > 0 since Yandex Music API returns all
  tracks in a single call; without this the controller pagination loop
  never terminates
- Add fetch_tracks_async() fallback when API returns playlist metadata
  without tracks
- Raise ResourceTemporarilyUnavailable instead of returning empty list
  when tracks are expected but unavailable, preventing cache of empty
  results
- Fetch full track details in batches of 50 to reduce timeout risk
- Retry get_tracks once on NetworkError in api_client
- Raise ResourceTemporarilyUnavailable on NetworkError in get_playlist
  to prevent caching None as empty result
- Suppress yandex_music library DEBUG logs to avoid huge API dumps

Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: apply ruff fixes and update snapshot

- Remove unused noqa comment (RUF100) in provider.py
- Update test_parsers snapshot for upstream model changes (year/style fields)

Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(yandex_music): fix missing album cover art in library

- In parse_track(), use parse_album() instead of ItemMapping for the
  track's album reference so albums are created with full metadata
  (including cover_uri) when tracks are synced to the library
- In get_liked_albums(), fetch full album details via client.albums()
  in batches of 50, since the users_likes_albums endpoint returns
  minimal data without cover_uri

Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(yandex_music): regenerate parser snapshots after models bump

Co-authored-by: Cursor <cursoragent@cursor.com>
* Update music_assistant/providers/yandex_music/api_client.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update music_assistant/providers/yandex_music/provider.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add tests for api_client batching/retry and playlist edge cases

Cover the 3 unresolved Copilot review comments from PR #3099:
- get_liked_albums() batch fetching and NetworkError fallback
- get_tracks() retry-on-NetworkError logic
- get_playlist_tracks() page>0, fetch_tracks_async fallback, empty batch error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------

Co-authored-by: Михаил Невский <renso@MacBook-Pro-Mihail.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
music_assistant/providers/yandex_music/api_client.py
music_assistant/providers/yandex_music/parsers.py
music_assistant/providers/yandex_music/provider.py
tests/providers/yandex_music/__snapshots__/test_parsers.ambr
tests/providers/yandex_music/test_api_client.py [new file with mode: 0644]
tests/providers/yandex_music/test_integration.py