music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.32k stars 49 forks source link

`argument of type 'int' is not iterable` #2387

Closed jlpouffier closed 1 month ago

jlpouffier commented 4 months ago

What version of Music Assistant has the issue?

2.0.4

What version of the Home Assistant Integration have you got installed?

2024.5.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

Every since I added the SoundCloud Provider, I have more and more issues playing artists from HA. This is because the artist page is buggy when selecting the SoundCloud provider.

Here is an example (Note I have two providers. Tidal and SoundCloud)

service: mass.play_media
target:
  entity_id: media_player.music_assistant_salon
data:
  media_id: Aya Nakamura
  media_type: artist

Causes issues on my side. The full trace is the following:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/mass/media_player.py", line 454, in _async_play_media_advanced
    await self.mass.player_queues.play_media(
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/player_queues.py", line 208, in play_media
    await self.client.send_command(
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/client.py", line 254, in send_command
    return await future
           ^^^^^^^^^^^^
music_assistant.common.models.errors.MusicAssistantError: argument of type 'int' is not iterable

If I search for that artist on Music Assistant I get two (main) results: CleanShot 2024-05-29 at 21 18 25@2x

One coming from Tidal, one coming from SoundCloud. Playing the artist from Tidal works OK. Playing the artist from SoundCloud does not, and yields the same error.

CleanShot 2024-05-29 at 21 19 22@2x

How to reproduce

Music Providers

SoundCloud Tidal

Player Providers

Airplay

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.5.5

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

OzGav commented 2 months ago

@jlpouffier A lot of changes have been since this report. Can you confirm if this is still an issue?

jlpouffier commented 2 months ago

I can and I will tomorrow! Thx a lot

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 14 days with no activity. Comment or this will be closed in 7 days.

OzGav commented 1 month ago

@gieljnssns any thoughts on this?

gieljnssns commented 1 month ago

I can not replicate this specific issue, but non of my soundcloud tracks is playing on airplay or on sonos.

OzGav commented 1 month ago

@jlpouffier is this still an issue?

marcelveldt commented 1 month ago

reproduced - will be fixed in 2.2.0b8 / 2.1.5

marcelveldt commented 1 month ago

This is fixed in 2.2.0 beta 8 - if the fix is confirmed working, it will also be included in the patch release 2.1.5 for the stable version

OzGav commented 1 month ago

@jlpouffier this will be closed soon assuming fixed