Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MixLink.cover_white #418

Closed
alryaz opened this issue Mar 5, 2021 · 1 comment
Closed

MixLink.cover_white #418

alryaz opened this issue Mar 5, 2021 · 1 comment
Assignees
Labels
bug Что-то не работает

Comments

@alryaz
Copy link

alryaz commented Mar 5, 2021

Опишите ошибку
Отсутствующий cover_white ломает всё. API не отдаёт требуемое значение на объекте.

Воспроизведение
Шаги для воспроизведения бага:
Не знаю, получится ли воспроизвести у вас (это data-driven ошибка), но:

  1. Создать объект (авторизация, и т.д.)
  2. Запросить подборки (Client.landing('mixes'))

Ожидаемое поведение
Должен вернуться объект LandingList

Логи
Стэктрейс:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/local/lib/python3.8/dist-packages/homeassistant/components/media_player/__init__.py", line 1068, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/development/YandexStation/custom_components/yandex_station/media_player.py", line 721, in async_browse_media
    response = await self.hass.async_add_executor_job(
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/development/YandexStation/custom_components/yandex_station/browse_media.py", line 841, in build_item_response
    landing_root = music_client.landing('mixes')
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/client.py", line 72, in wrapper
    result = method(*args, **kwargs)
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/client.py", line 546, in landing
    return Landing.de_json(result, self)
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/landing/landing.py", line 63, in de_json
    data['blocks'] = Block.de_list(data.get('blocks'), client)
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/landing/block.py", line 111, in de_list
    blocks.append(cls.de_json(block, client))
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/landing/block.py", line 85, in de_json
    data['entities'] = BlockEntity.de_list(data.get('entities'), client)
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/landing/block_entity.py", line 104, in de_list
    entities.append(cls.de_json(entity, client))
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/landing/block_entity.py", line 84, in de_json
    data['data'] = de_json.get(data.get('type_'))(data.get('data'), client)
  File "/development/YandexStation/deps/lib/python3.8/site-packages/yandex_music/landing/mix_link.py", line 120, in de_json
    return cls(client=client, **data)
TypeError: __init__() missing 1 required positional argument: 'cover_white'

Объект с приколом:
{'title': 'Books for school', 'url': '/tag/literature?sort=popular', 'url_scheme': 'yandexmusic://tag/literature?sort=popular', 'text_color': '#ffbb5a', 'background_color': 'transparent', 'background_image_uri': 'avatars.yandex.net/get-music-misc/40584/mix.5f47b6e3474cc52b8929b70d.background-image.1598535530231/%%'}

Дополнительная информация
...

@alryaz alryaz added the bug Что-то не работает label Mar 5, 2021
alryaz added a commit to alryaz/yandex-music-api that referenced this issue Mar 5, 2021
@MarshalX
Copy link
Owner

MarshalX commented Apr 7, 2021

l = c.landing('mixes')
type(l)
<class 'yandex_music.landing.landing.Landing'>

Не могу воспроизвести. Мой тг бот тоже не ловил такого исключения

@MarshalX MarshalX closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Что-то не работает
Projects
None yet
Development

No branches or pull requests

2 participants